Hi everyone!
I need to rotate a ship at its creation by a given angle of pitch, roll and yaw. I send a VECTOR3 that looks like this: _V(90, 0, 0), and my method should rotate the created vessel.
I have no knowledge of Euler angles, and only basic knowledge of matrices.
I managed to create a matrix that rotates the mesh correctly (tested with SetRotationMatrix). However, calling SetRotationMatrix leads to a little "popping" of the mesh (Orbiter doesn't refresh the matrix in the same frame?).
So, I would like to apply the matrix before creating the vessel: in VESSELSTATUS::arot. However, converting the matrix to the Euler angles does not work. I use the described formula in Orbiter API's documentation:
alpha = atan2(R23, R33)
beta = asin(R13)
gamma = atan2(R12, R11)
The results are weird. I can't find any consistency.
What am I doing wrong?
I need to rotate a ship at its creation by a given angle of pitch, roll and yaw. I send a VECTOR3 that looks like this: _V(90, 0, 0), and my method should rotate the created vessel.
I have no knowledge of Euler angles, and only basic knowledge of matrices.
I managed to create a matrix that rotates the mesh correctly (tested with SetRotationMatrix). However, calling SetRotationMatrix leads to a little "popping" of the mesh (Orbiter doesn't refresh the matrix in the same frame?).
So, I would like to apply the matrix before creating the vessel: in VESSELSTATUS::arot. However, converting the matrix to the Euler angles does not work. I use the described formula in Orbiter API's documentation:
alpha = atan2(R23, R33)
beta = asin(R13)
gamma = atan2(R12, R11)
The results are weird. I can't find any consistency.
What am I doing wrong?