Alright I'm having a hard enough time with ship rotation deltas I've started diving into quaternions.
Using excel spreadsheet:
Assume it starts at A1
=COS(Z) * COS(Y) | =SIN(Z)*COS(X) + COS(Z)*SIN(Y)*SIN(X) | =SIN(Z)*SIN(X) -COS(Z)*SIN(Y)*COS(X) |
=-SIN(Z)*COS(Y) | =COS(Z)*COS(X) - SIN(Z)*SIN(Y)*SIN(X) | =-COS(Z)*SIN(X)+SIN(Z)*SIN(Y)*COS(X) |
=SIN(Y) | =COS(Y) * SIN(X) | =COS(Y)*COS(X) |
If I punch in the right X,Y,Z then the results will look good compared to the in-game Orientation matrix.
Then I convert that matrix into a quaternion:
QW =SQRT(1+A1+B2+C3)/2
QX =(C2-B3)/(4*qw)
QY =(A3-C1)/(4*qw)
QZ =(B1-A2)/(4*qw)
Say i take (0,0,45)
I get :
.713 | .700 | 0 |
-.700 | .713 | 0 |
0 | 0 | 1 |
Problem is the results are W=.92541 X = 90, Y = 90 Z = 45
Why the 90's?
Or better yet.. does anyone have a good way of taking the change in a ships rotation and comparing it to the previous frame's i.e. the delta change in pitch/bank/roll for all three axises?