Jump to content
  • Advertisement
Sign in to follow this  

Rotating quaternions

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

I'm currently working on a math library for my engine and I wnted to know if there was a convenient way of rotating (yawing, pitching and rolling) a quaternion. The only rticles I've read so far deal mostly with constructing quaternions as well as some simple operations. Is multiplying the only way? I would use eulers or the axis-angle method (the testing bed for the class is an FPS cam) but I don't want to deal with the different matrix multiplications (translate, Y rotate, X rotate, Z rotate) for simplicity and speed.

Share this post


Link to post
Share on other sites
Advertisement
There are shortcuts for rotating a quaternion about one of its local axes - I have code for this which I'll post if you're interested. You can also write specialized functions for rotating a quaternion about a world axis. For arbitrary axis-angle rotation, just multiply by the appropriate quaternion.

I don't know if that answers your question or not, but please ask if you need clarification.

Share this post


Link to post
Share on other sites
yeah, that sounds like what I need: a few simple functions for rotating a quaternion around it's local axis as well as world axis (for Y and Z rotation in the FPS cam). I'll probably end up implementing a uility function for arbitrary axis rotations, but for now all I need is code fo the X, Y and Z axis

The code would be very much appreciated!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!