Jump to content

  • Log In with Google      Sign In   
  • Create Account

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.

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

#1 puma   Members   -  Reputation: 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!

Sponsor:

#2 Prod   Members   -  Reputation: 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   -  Reputation: 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   -  Reputation: 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.



PARTNERS