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

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

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 on other sites
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 on other sites
Quote:
 Original post by ManaStonex, 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 ManaStoneBecause 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

• 21
• 16
• 9
• 17
• 13