glRotate and Picking problem

I am rotating my objects with rubber band mechanism. But , after that i am not able to pick the object . So, What was the problem . I am not getting .
So, please help me .
Thanks in advance.

Dude, we need way more details about your problem. You simply said you had a problem with picking, and that’s not much of a description.

My code looks like this

glTranslatef(transX, transY, 0.0);
glRotatef(rotX, rotY, rotZ);

And , for picking , I am using the gluPickMatrix routine . So, when I translate by dragging the mouse, I am not able to pick the translated object.


unless I’m mistaken once you’ve popped the matrix you’ve removed the info from the current matrix, so you really can’t pick the object. I think you gotta have the gluPickMatrix routine work before you use glPopMatrix();

not sure though. Probably why i cruise at the beginners forum…

Selection uses the current matrix. So if you pop the matrix you will have changed it from the one you drew with. You definately need to do the selection before calling glPopMatrix.