I am using glSelectBuffer to pick onscreen objects, with no problem. Part of my program is a physics editor that allows the user to push and pull objects around in real time. For this, I need to know the position of the pick, so that I can apply force with the right position and vector.
How can I get the point in 3D space that was picked, or at least the z-distance in front of the camera that was picked (so I can transform it to 3D space)? gluUnproject takes a z-parameter, so I can’t try to use it without knowing how far away my picked point is.