Advertisement Jump to content


This topic is now archived and is closed to further replies.


Rotate object around it's center

This topic is 5340 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 programming a game in OpenGL and I''m wanting to rotate an object around the center of the object rather than the bottom corner. From doing a bit of reading I believe I can do this using quaternion but I can''t quite figure it out. Is there an easier way of doing it or can someone point me to a good description of how I can do it. Cheers, Darrell

Share this post

Link to post
Share on other sites
One way to do it would be to translate to the center of the object, then apply your rotation, then draw the object about its center:

glLoadIdentity () ;
glTranslate* (xCenter, yCenter, zCenter) ;
glRotate* (...) ;
//Draw Object

The current 3D position is the one that glRotate* will use to rotate about (i.e. whatever the 3D position is when glRotate* is called is what is used as the center of rotation). If you need something more specific, help us out and supply us with more information about what you are doing/how you're drawing the object, etc.


[edited by - urayami on June 4, 2004 3:24:02 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!