Original Post
hello, i would like to know how to convert the mouse 2d screen coordinates to 3d coordinates ... without using GLuUnprojet(). I know the z coordinate canot be known since it is lost in 2D. However, what i'm trying to do is to backprojet the 2D point and get its z value from the intersection with a 3d sphere. what i did is what i'd thought it would be ok to do, but i'm not sure. Could you math/GL gurus tell me if it is ok ? many thanks : 1 - i have a 2 mouse point, say, x_mouse = (x,y). 2 - i convert the point to 3D by setting X_mouse = (x,y,z,1), with an arbitrary z. 3 - i "backproject" the point using the inverse perspective projection matrix (defined here at the bottom http://glprogramming.com/red/appendixf.html) 4- i get a point which is X_mouse_3D = (a,b,c,d,e), which i normalized by thelast coordinate : X_mouse_3D_normalized = (a/e,b/e,c/e,d/e,1) 5 - i get the 'real' z coordinate of X_mouse_3D_normalized by replacing the coordinates of X_mouse_3D_normalized in the equation of a sphere i know is it clear ...? is this the way i should do it ? thanks in advance ;)