How could I get the real-time rotation angles of the 3D image? SOS!

You can find a script that prints anatomical angles (RAO/LAO, CRA/CAU) in the corner of a 3D view in this post.