In order to animate a mesh I have to calculate a transformation matrix and I know how to do that. What I'm currently struggling is how to get the angles (Pitch and Yaw) of the rotation axis. So let's have a normalized 3D vector (x, y, z), to get the Pitch angle I'm using
Code: Select all
PokeF(*Pitch_Float, ASin(*This\y))
Code: Select all
PokeF(*Yaw_Float, ATan2(*This\x, *This\z))
Code: Select all
PokeF(*Yaw_Float, ATan2(*This\z, *This\x))
Any suggestion ?
Best regards
StarBootics