Jump to content
  • Advertisement


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


what are the parameters of glRotatef?

This topic is 6154 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
i didnt mean to double post...

i dont understand the first parameter and how it works with the others, could u possibly elaborate further?

"Those who serve no purpose, have no purpose"

Share this post

Link to post
Share on other sites
x,y,z describe the vector axis that the rotation angle is supposed to rotate around. the angle is the amount.

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!