PDA

View Full Version : move a object withoud gltranslate



10-13-2002, 09:13 AM
if i modify the matrix ( glTranslatef), i move through all the objects in the glut window, but may i move THE OBJECTS without use the matrix?
thks

nexusone
10-13-2002, 11:28 AM
In the end everything is put in the matrix().

You can do matrix math to do a translation with out using glTranslate, if that is what you are looking for.

I think you movement problem is you lack of understanding for how opengl works.

It is very simple, to move a object without moving others by using glPushMatrix and glPopMatrix.

glPushMatrix();
glTranslatef(......); // move this object only
glRotatef(......); // rotate this object only

draw_object();

glPopMatrix();

draw other objects that are not moving.


Originally posted by XNEON:
if i modify the matrix ( glTranslatef), i move through all the objects in the glut window, but may i move THE OBJECTS without use the matrix?
thks