PDA

View Full Version : picking question



unixcrab
11-06-2001, 05:46 AM
hi,

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?

thanks
mr T

pythagoras
11-06-2001, 11: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()?

unixcrab
11-07-2001, 07:46 AM
hi,

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

unixcrab
11-07-2001, 08: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.