Hi,
I used gluUnprojet to pick up the object coordinates where the user clicked in my window…
I do not arrive to obtain the good values.
-
I calculate at the beginning of the program a Z value that will place the camera in order to see all the object Z=-431 for the object I’m actually using. After the user can change the Z value in order to give a zoom impression on the object. I use glTranslate for moving the camera…
-
I set up the the gluperspective like this:
glu.gluPerspective(Angle_View_Degree, width/height, 10.0f, 500.0f);
in order to zoom on the object. If I give a Z value between -10 and -500 I can see the object. -
The gluUnproject is initialised like this:
glu.gluUnProject((double)X,(double)Y,depthbuffer[0],mvmatrix,projmatrix,viewport,x,y,z)
I don’t think the problem comes from here…
Now with this configuration I can’t get the corrects object points and Z=421…
I think there is something I don’t understand in the configuration of gluPerspective combined with changing the Z value with glTranslate…
Anyone has an idea
Thanks for your help
Mat