hi all
right - given i'm a maths numpty and understand about 1 in 10 of the words related to quaternion texts, could someone give me help w/ a quat multiplication problem please?
i'm building external camera views for a view of the player's spaceship. texts i'm working from say, eg,
q1 = 0 1 0 0 is a 180 rotation about the X axis
q2 = 0 0 1 0 is a 180 around the Y axis.
this much i understand.
my camera by default points forward along the Z axis, and using the above theory etc i've got rear, left and right views. i've even managed to get my rear camera slightly raised and looking down for a cool angle on the ship. where i'm hitting porbs is a similar looking-down angle on the front. this means rotating the camera 180 around the Y axis, and angling it down a bit around the X axis. i'm failing miserably.
i've worked out i can do this by doing a 135 rotation around X so i'm facing back and down, and a 180 around Z to bring the image the right way up. the 2 quats i reckon are :
q1 : 0 0.9238 0 0
q2 : 0 0 0 1
now, all the texts say :
"To multiply Q1 (w1, x1, y1, z1) by Q2 (w2, x2, y2, z2):-
W = w1 x w2 - x1 x x2 - y1 x y2 - z1 x z2
X = w1 x x2 + x1 x w2 + y1 x z2 - z1 x y2
Y = w1 x y2 + y1 x w2 + z1 x x2 - x1 x z2
Z = w1 x z2 + z1 x w2 + x1 x y2 - y1 x x2 "
but as you can see, everything ands up as a multiplication by zero, nilling everything. so what am i not understanding?
thanks in advance.