Up Vector from Quaternion

Hi there;
I’m using quaternion to hold the rotation of my spaceship, but after some rotations, the Up Vector get “wrong”. I know that it’s normal, but how can I turn it into (0,1,0) again, keeping the orientation the same as before? And how can I extract it ( the Up Vector) from my quaternion?
thanx…

Storing your rotations using quaternions is a good thing… Unfortunately quaternion’s values are not easy to manipulate as is…

Then maybe be u should use euclidian coordinates (euler angles) and directly work with nice values along the cool trigonometric circle. It will be also easier to clamp or loop values per axis for your up vector problem…

That’s it there are many docs for converting matrices,eulers,quaternions out there
check out the matrix quaternions faq.

hth

[This message has been edited by Ozzy (edited 03-23-2003).]