PDA

View Full Version : independent object in environment



11-28-2000, 05:36 PM
You guys and girls helped out a lot for my last question, hopefully you all can help me out again! I have an object inside a sphere (a world) by using nested transformations. But how do I get the object to move independently of the world? How do I rotate the object without rotating the whole world?

Thanks!

kyokpae
11-29-2000, 03:55 AM
You have to use glPushMatrix() and glPopMatrix() to have this object independent. Simply do this:

glPushMatrix();

[Here rotate&move your object and draw it]

glPopMatrix();

Pushing transformation matrix to the heap
will effect in having NULL trans. matrix
so then obejct will look like his moves are independent. Thanks to popping the trans. matrix you can continue your work with other objects.

see ya

[This message has been edited by kyokpae (edited 11-29-2000).]