Archived

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

help with glrotatef(...)

This topic is 5856 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 would like to rotate a cube around it''s centerpoint, so that it would stay on it''s position and rotate. Problem is, that rotatef rotates the cube around the origin. How can I get the cube rotating around it''s center? Thanks!

Share this post


Link to post
Share on other sites
its a common simple problem. What you probably have is something like this:

glVertex2f(0,0);
glVertex2f(10,0);
glVertex2f(10,10);
glVertex2f(0,10);


What you need to do is move the cube over so the center of it is at (0,0)

like this:
glVertex2f(-5,-5);
glVertex2f(5,-5);
glVertex2f(5,5);
glVertex2f(-5,5);






Share this post


Link to post
Share on other sites