quaternion rotation matrix

Started by
2 comments, last by tksuoran 17 years, 10 months ago
hi all , i wonder if i can extract my view vectors from a rotation matrix builded by a quaternion that is : qRot = qYaw*qPitch*qRoll // Combined rotation quaternion and i build a rotation matrix from qRot. can i get the column of the matrices as my Up Right and Look Vectors for the camera ? thanx for your help
Advertisement
The short answer is yes.

The longer answer is that there are a few different issues involved, such as quaternion multiplication order, row and column vector convention, and whether you extract the basis vectors before or after inverting the view matrix (if inversion is necessary). So a more accurate answer might be, you can get the view vectors from one or the other of the rows or columns, depending on the circumstances.

I might also mention that the use of quaternions in this example doesn't serve any purpose to speak of; you could just as easily accomplish the same thing with matrices alone.
Quote:Original post by jyk
I might also mention that the use of quaternions in this example doesn't serve any purpose to speak of; you could just as easily accomplish the same thing with matrices alone.


I want to interpolate rotation easily that's why i use quaternions ...

when i pitch past pi/2 , i get strange behaviors , when i only do yaw without pitch it is okay...

can you explain more about the circunstances under you cannot extract the basis vectors ?

thanx
Quote:Original post by nini
can you explain more about the circunstances under you cannot extract the basis vectors ?
thanx


Google for quaternion euler angles. The first link that seems pretty useful is http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm

This topic is closed to new replies.

Advertisement