Jump to content
  • Advertisement
Sign in to follow this  
GaryNas

Quaternions and Angle/Axis

This topic is 4641 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

Hey guys. I'm just getting into quaternions which is working out well, except for one thing. I don't really understand how to build my axis-angle representation for my vector n; where the quaternion is [w (nx ny nz)]. As an example, say I want to rotate 30 degrees around the x-axis and 55 degrees around the y-axis; how can I use those values to build my axis-angle? I realize that I can create two separate quaternions for each rotation and multiply them together, but for the sake of learning I'd like to try it this other way. Thanks! :)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by GaryNas
As an example, say I want to rotate 30 degrees around the x-axis and 55 degrees around the y-axis; how can I use those values to build my axis-angle? I realize that I can create two separate quaternions for each rotation and multiply them together, but for the sake of learning I'd like to try it this other way.

I don't know of any other way. What you're doing, of course, is using euler angles to generate a quaternion. And multiplying several axial rotations together is "how it's done". HUTTAH!

Share this post


Link to post
Share on other sites
It is easier to just multiply the 3 quaternions as Sneftel suggests, but for the sake of learning you might go the extra step of reducing the math. The quaternions are
    qX = [ sin α/2, 0, 0, cos α/2 ]
qY = [ 0, sin β/2, 0, cos β/2 ]
qZ = [ 0, 0, sin γ/2, cos γ/2 ]
and a lot of terms should drop out when you multiply the quaternions.

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!