Jump to content
  • Advertisement
Sign in to follow this  
nini

quaternion rotation matrix

This topic is 4436 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!