get angle


#1

I want to find the angle between the viewport and ObjA’s rotation,
fn GetVectorsAngle v1 v2 =
(
theAngle = acos (dot (normalize v1) (normalize v2))
)
v1 = ObjA.pos - ObjA_front_OBJ_pos
v2 = ObjA.pos - viewportOBJ_pos
GetVectorsAngle v1 v2
With this script I can get the angle I want
However, the value of ObjA_front_pos can not be obtained.
If ObjA is located at 0,0,0 and facing the front, the ObjA_front_pos value will be 0, -10,0.
But what if it looks elsewhere?
I do not know how to save it
And through getViewTM (), I can find out the position and angle of the viewport to Matrix. However, we do not know how to use this to get the v2 value.
Please help me.