I have a spaceship flying through a $3D$ space. The flight is determined by applying a quaternion to the look, up, and cross vectors with the following scheme (this is working perfectly):
starting values: cross: $(1, 0, 0)$ up: $(0, 1, 0)$ look: $(0, 0, 1)$
to apply yaw:
- set quaternion axis to up vector and set quaternion angle to change in yaw
- rotate look and cross vectors by quaternion
to apply pitch:
- set quaternion axis to cross vector and set quaternion angle to change in pitch
- rotate up and look vectors by quaternion
to apply roll:
- set quaternion axis to look vector and set quaternion angle to change in roll
- rotate cross and up vectors by quaternion
All three vectors are always normalized.
All three vectors remain orthonormal to one another.
The direction of the velocity of the ship is set to the look vector.
This works great. I have thoroughly tested it. I fly my ship through 3D space with full freedom of movement across all three axes and no singularities.
The problem I cannot solve is rotating the spaceship model so that it corresponds with the orientation of the look, up and cross vectors. I need to create a vector with the following values: ($x$-axis rotation, y-axis rotation, z-axis rotation) I can set the Euler order to any order I want. I have used everything I know about trig and linear algebra for about the last 48 hours, but I just can't seem to find a way to get the axis rotations from the normalized directional vectors. Thanks ahead of time for any help.