PDA

View Full Version : Selecting which obj to move



SeeDAreW
03-06-2002, 06:07 AM
I want to have 2 moving objs in the project, but I want to move the one by one, how will I do that???

chxfryer
03-06-2002, 06:57 AM
Are you talking about ie., having the mouse click on one and drag it around, if so use OpenGl Selection in conjuction with the mouse coordinates. http://www.opengl.org/developers/code/sig99/advanced99/notes/node35.html?selection+buffer#first_hit
or if your talking about moving them independantly of each other just just gl(Push/Pop)Matrix;
//First object
glPushMatrix();
glRotatef(blah,blah,blah,blah);
glTranslatef(blah,blah,blah);
//Draw stuff here
glPopMatrix();
//second object
glPushMatrix();
glRotatef(blah,blah,blah,blah);
glTranslatef(blah,blah,blah);
//Draw stuff here
glPopMatrix();
and so on....
if these are not what you meant, please explain...
The Chicken Fryer