Archived

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

what are the parameters of glRotatef?

This topic is 5870 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

void glRotatef( GLfloat angle,
GLfloat x,
GLfloat y,
GLfloat z )

Look at this website: The OpenGL WWW Pages

Also, this post was probably unnecessary since you could have found it using any search engine.

Also, you generally don't wanna double-post in GameDev.net; it's not proper "etiquette."

If you are in search of a good search engine go to Google

EDIT: I dislike how if you don't put http:// before the line on anchors the browser thinks that you want to go to a subdirectory of the page your looking at.

Edited by - Floppy on November 16, 2001 7:13:27 PM

Share this post


Link to post
Share on other sites
The angle is how much you want to rotate by. Then you want to tell it which axis to rotate on by puting a 1.0 in that field and having the others as 0.0.

So: glRotatef(1.0, 0.0, 1.0, 0.0) tells it to rotate one unit on the y axis.

To have the object to keep spinning, you would put a variable there and increment the
variable in a loop like so


float Angle = 0.0;

glRotatef(Angle, 1.0, 0.0, 0.0);
Angle += 1.0f

if(Angle == 360.0);
Angle = 0;


This would have the object keep rotating on the x axis


hope thats what you wanted

Share this post


Link to post
Share on other sites