View Full Version : rotate object?
04-27-2001, 03:34 PM
Hi I'm a newbie and I'm trying to rotate an object independent of the viewing camera. What function do I use? I know how to use gluLookAt() to move the camera already, but want to move just the object.
Thanks in advance!
do something like this:
glRotated(degrees, x, y, z);
//draw stuff you want rotated here
glPushMatrix() will store the current state so you don't rotate stuff you have already drawn
in glRotated() degrees is the amount of rotation, and set x,y,and z to a non-zero number in order to rotate along that axis
then use glPopMatrix() to bring back the stuff from before
there are some fine points to this but just practice with it a little
oh remember this....
in relation to your monitor:
x is left right
y is up down
z is in out
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.