glRotate and Picking problem

Hi,
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.
-sadhu

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

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

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.

thanks

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.