PDA

View Full Version : Picking problem



Jon723
06-23-2004, 03:25 PM
I'm trying to debug my program that implements picking with the mouse. I'm able to pick objects with the mouse when I dont move my camera but as soon as I move my camera and try to select an object it wont detect a selection. Im using gluLookAt in my render function to position my camera. I also call gluLookAt in the mouse function just before I render the scene in GL_SELECT mode. Whats causing the camera to screw up the selection??

plasmonster
06-23-2004, 06:08 PM
Hmmm, well, it could be anything. A common problem is name initialization, or lack thereof. Another common problem is the picking rectangle setup. gluPickMatrix can be used for this, but it must be the first matrix on the projection stack. I could go on, but the list is quite lengthy. I suggest you post the relevant selection code here.

This chapter from the Red Book might help
http://fly.cc.fer.hr/~unreal/theredbook/chapter12.html