View Full Version : rotating........
07-25-2001, 10:23 AM
ok i'm very new to OpenGL just got everything working /linking/ and stuff which took me two days to get! now i juade made this human with spheres and cubes, it looks pretty cool but the think is i want to be able to rotate the guy and see is back and is side........i know about the glRotatef function but not quite sure how to use it....can someone shed a little light on this please.....thank you
07-25-2001, 11:11 AM
You call glRotate just before rendering your object and you do that to the modelview matrix.
If you're new, post to the beginners group. Besides, there are tons of demoes out there such as at the ati and nvidia site.
07-25-2001, 11:18 AM
woops, this is the beginners forum!
07-26-2001, 05:39 AM
glRotatef makes a rotation around an axis. You have to specify the angle of rotation, together with the (x,y,z)-coordinates of a vector lying on this axis. The call looks like :
glRotatef (angle_in_degrees, axis_x, axis_y, axis_z);
for example, you could write glRotatef (180, 0, 1, 0); if you want to make an half turn around the y-axis.
P.S.: you have to call glRotatef BEFORE drawing your model. Your display function should look like
glLoadIdentity (); //cancels old calls to glRotatef
glutSwapBuffers (); //if you're using glut
I hope that this will help.
[This message has been edited by Morglum (edited 07-26-2001).]
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.