PDA

View Full Version : Strange value from gluUnProject



tranckhanh
05-31-2001, 12:28 AM
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.

DaViper
05-31-2001, 02:43 AM
hmm do a search on picking in this forum, there are lots of posts...


(fourth time wirting this comment in 2 days...gee people search in here before asking..)

Chris