Dears,
I am developing an application that allow user draw in 3D scene. I start
with a small program: track the mouse click to receive the coordinate (x,y,z)
I wrote in the function OnLButtonDown
(as Martinijy’s solution ) :
GLdouble model[16];
double x;
double y;
double z;
GLdouble proj[16];
GLint view[4];
glGetDoublev(GL_MODELVIEW_MATRIX, model);
glGetDoublev(GL_PROJECTION_MATRIX, proj);
glGetIntegerv(GL_VIEWPORT, view);
gluUnProject((GLdouble)point.x, (GLdouble)point.y, (GLdouble)0, model, proj, view, &x, &y, &z );
But the result shock me ! They produce some great values, I can’t
continue processing with them.
Please help me to solve this prolem !
Thanks.