here is my code for a picking method with the mouse. when i have an object picked i try to move it but all the objects move. i know this is to do with the pushMatrix and pop matrix but i thought i had that done. am i calling them in the wrong place or what am i doing wrong. thanks.
GLuint selectBuff[BUFSIZE];
GLint hits, viewport[4];
glSelectBuffer(BUFSIZE, selectBuff);
glGetIntegerv(GL_VIEWPORT, viewport);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glRenderMode(GL_SELECT);
glLoadIdentity();
gluPickMatrix(x, viewport[3]-0.1,0.1, viewport);
glOrtho(0, 0, 0, 0, 0, 0);
glMatrixMode(GL_MODELVIEW);
displayfn();
hits=glRenderMode(GL_RENDER);
printf ("hits = %d
", hits); glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
if(hits > 0)
picked = selectBuff[3];
then i have something like
if(picked){
glTranslatef(0.5,0.5,0.5);
}