Advertisement

Howto clear opengl window

Started by April 05, 2006 10:57 AM
10 comments, last by nefthy 18 years, 10 months ago
glTranslate() is the right way to position objects. You can use glPushMatrix() and glPopMatrix() to save and restore the current transformation matrix.

Lets say you want to draw obj1 and obj2, both relative to the current transformation (instead of relative to each other) you would do something along these lines:
glPushMatrix();glTranslate(obj1.x, obj1.y, obj1.z);draw(obj1);glPopMatrix();glPushMatrix();glTranslate(obj2.x, obj2.y, obj2.z);draw(obj2);glPopMatrix();


You might want to take a look at the NeHe tutorials. They will get you started.

This topic is closed to new replies.

Advertisement