Jump to content
  • Advertisement
Sign in to follow this  
MrBob

Rotations

This topic is 4261 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 have a simple stick figure that i am trying to add animations to him in opengl and i was wondering.. is there any way to rotate a point about an arbitrary axis in space other than with Quaternions? I know that i could translate to the origin, rotate, and then translate back, but that does not seem to be a effective way to handle joint rotations in a skeleton.

Share this post


Link to post
Share on other sites
Advertisement
A quaternion represents a rotation (or more precisely an orientation). There are other representations, such Euler angles, axis/angle, and 3x3 matrix. No matter which representation you choose, the method of doing the rotation will be the same (though the implementation will differ).

In OpenGL, glRotate() is used. It takes an angle (in degrees) and the X, Y, and Z components of a axis.

I hope that answers your question. Your question seems a little confused.

Share this post


Link to post
Share on other sites
Keep in mind that with skeletal animation (where one vertex of a polygon may have a different parent bone than another vertex of the same polygon) you'll probably have to apply transformations to each vertex before you draw them. glRotate(), glTranslate(), glLoadMatrix(), etc. will throw an error if you pass them in between glBegin() and glEnd() statements. Matrix implementations are particularly good for this because:

0) You probably won't want to normalize your result (which is a key advantage quaternions have over matrices) as you're interpolating between key-frames
1) matrices have more general applications (so you can use them in other areas of your code)
3) Matrix multiplication is EASY!

Share this post


Link to post
Share on other sites
Thanks for the info. I think i'm going to stick with using a matrix instead of trying to implement 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!