PDA

View Full Version : rotation



12-03-2003, 03:56 AM
I want to rotate an object in my scene but on rotation the whole scene is rotating. How can i make just the object rotate, and the rest of the screen remain stationary?

I am using keyboard input to controll the rotation.

Thanks

nexusone
12-03-2003, 06:20 AM
As you know all matrix operations effect every object after they are used, so you have to use glPush/PopMatrix to save the matrix state before a translate or rotate you do not want to effect other object drawn after.

// Start Object
glPushMatrix(); // Save current matrix to stack
glRotate(......);
draw_object();
glPopMatrix(); //Load saved matrix from stack



Originally posted by Saxo:
I want to rotate an object in my scene but on rotation the whole scene is rotating. How can i make just the object rotate, and the rest of the screen remain stationary?

I am using keyboard input to controll the rotation.

Thanks