Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

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


Sign up now

help with glrotatef(...)

4: Adsense

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.


  • You cannot reply to this topic
3 replies to this topic

#1 puma   Members   

122
Like
Likes
Like

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!

#2 Prod   Members   

134
Like
Likes
Like

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








#3 Dredge-Master   Members   

175
Like
Likes
Like

Posted 05 January 2002 - 05:59 AM

or use glTranslate3f() to centre the cube first



Beer - the love catalyst
good ol'' homepage

#4 AIRmichael   Members   

136
Like
Likes
Like

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.