View Full Version : rotation
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, 05: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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.