Quaternion to degree....

Started by
2 comments, last by mind in a box 13 years, 9 months ago
Hi,
I'm making a 2D Mario like game and I want to use the Bullet-library for the physics. Bullet runs fine so far, but I have trouble with converting the quaternion rotation into degrees (Which Direct2D wants). Since it is 2D, I only need one axis (I think it's the Z-Component of the quaternion-vector). Here is what I tried, but it gives only half-correct results, so I think I do it wrong. [smile]



Advertisement
I just found
D3DXQuaternionToAxisAngle
but I don't know how to use it...
Use the quaternion to transform a vector (1,0,0), then take the transformed vector, ignore the Z component, and calculate atan2(Y,X) to obtain the angle around the Z axis the rotation represents.
That worked, thank you!

This topic is closed to new replies.

Advertisement