I’m trying to calculate the real world coordinates of a point on a sphere with texture map, from the coordinates of a mouse click.
I have experimented with gluUnproject but I seem to be getting nonsense for output!
I’m not really sure how to use glDepthRange() to get the z coordinates - I’ve tried using glReadPixel to get this but I always seem to get the same value wherever I click the mouse.
Any help would be greatly appreciated!
[This message has been edited by gevans2000 (edited 11-19-2002).]
I have used gluUnpoject and I’m getting the z value from glReadPixels. This always seems to give the same value though. I’ve read somewhere that if the near clip frame is to close to the camera position then glReadpixels can be inaccurate - any ideas how close it means. At the moment my sphere has radius 1.0 and my camera is at (0.0,0.0,3.0) with the near clip frame 1.0 away from the camera. Is this too close? Could this cause the z value read from glReadPixels to always be the same (very small) number?