View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# help with glrotatef(...)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1puma  Members

Posted 05 January 2002 - 03:05 AM

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!

### #2Prod  Members

Posted 05 January 2002 - 05:02 AM

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);

### #3Dredge-Master  Members

Posted 05 January 2002 - 05:59 AM

or use glTranslate3f() to centre the cube first

Beer - the love catalyst
good ol'' homepage

### #4AIRmichael  Members

Posted 05 January 2002 - 08:48 AM

First use glTranslatef, and after that glRotatef.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.