Jump to content
  • Advertisement
Sign in to follow this  
ManaStone

Does glRotatef() use a quaternion to implement the rotation?

This topic is 5014 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 was just curious if it does this. From reading Jim Adam’s book, I got the impressions that the main differences between a regular rotation and a quaternion rotation is that the regular rotations are based along the x, y, or z axis and can have problems with concatenation, whereas the quaternion rotations can rotate along a vector. Because glRotatef() gives you a vector to rotate around, I thought that it might be implemented using a quaternion.

Share this post


Link to post
Share on other sites
Advertisement
very doubtful

opengl works with matrices. Somewhere I'm sure you can find the formula for a rotation matrix around an arbitrary axis (google for example). Though I don't know for sure I assume glRotate just builds an appropriate rotation matrix and then calls glMultMatrix with that matrix. Using a quaternion would add an extra unnecessary conversion.

Share this post


Link to post
Share on other sites
Quote:
Original post by ManaStone
x, y, or z axis and can have problems with concatenation,


Are you sure your not talking about Euler angles there not the same, rotation matrices don't suffer from gimbal lock.

Quote:
Original post by ManaStone
Because glRotatef() gives you a vector to rotate around, I thought that it might be implemented using a quaternion.


Opengl work with 4-by-4 matrices, it puts the angle into a rotatation matrix and then multiplies it with the current model-view matrix.

you might wont to read this

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!