I am trying to implement a ray based picking system instead of having OpenGL do it using name stacks… I have lots of cores, and my GPU is quite busy!!
I have tried this method…
One way to generate a pick ray is to call gluUnProject() twice for the mouse location, first with winz of 0.0 (at the near plane), then with winz of 1.0 (at the far plane). Subtract the near plane call’s results from the far plane call’s results to obtain the XYZ direction vector of your ray. The ray origin is the view location, of course.
But it seems very inaccurate, even when using double precision.
Am I missing something, or is this generally accepted as being inaccurate?
Unfortunately the link to the SGI FAQ is dead.