View Full Version : picking question

11-06-2001, 04:46 AM

I've setup picking as layed out in the red book and it works ok except for one problem. If I rotate or translate the scene around the picking point becomes disconnected with the object I'm picking. i.e. : if I have a cube in the middle of the scene and perform no rotations/translations it picks fine. if I then rotate/translate then I have to click to the right or left of the object to select it and in some cases the object becomes unpickable. before I post any code, is this a common problem with a common solution?

mr T

11-06-2001, 10:06 AM
As long as the transformations are included in the code that's rendered in selection mode, it should work OK.

Are you using gluPickMatrix()?

11-07-2001, 06:46 AM

like I said, I'm doing it _exactly_ like the red book, instead i'm using quadric spheres in perspective instead of squares in ortho. I've now noticed that the further away from the origin (i.e. 0,0,0) the object is, the bigger the gap from the picking point to the actual object. I've tried both Mesa3.5 and the latest nv drivers on a GF1 in redhat 7.1. This is driving me insane as I've tried other picking demos from romka etc and it still bloody does it!

please help, I'm reaching for the razor blade... http://www.opengl.org/discussion_boards/ubb/frown.gif

11-07-2001, 07:05 AM
I always think people who reply to their own problems are a bit well... wierd.

I found the problem and its a strange one. If i replace the calls to gluPerspective() with glFrustum() it works perfectly! whats up with that?

Mr C Onfused.