jirkamelich

12-10-2002, 10:33 AM

I'm trying to use gluUnProject, can somebody tell me, if the following source code should work ? I tryed on my computer, but it kind of froze, i don't know if it is my win or the bad source code. Myska is type GLdouble.

GLdouble ObjX;

GLdouble ObjY;

GLdouble ObjZ;

GLdouble ModelViewMatrix;

glGetDoublev(GL_MODELVIEW_MATRIX,&ModelViewMatrix);

GLdouble ProjectionMatrix;

glGetDoublev(GL_PROJECTION_MATRIX,&ProjectionMatrix);

GLint ViewPort;

glGetIntegerv(GL_VIEWPORT,&ViewPort);

gluUnProject(Myska.Xpos,Myska.Ypos,1.0,ModelViewMa trix,ProjectionMatrix,ViewPort,&ObjX,&ObjY,&ObjZ);

GLdouble ObjX;

GLdouble ObjY;

GLdouble ObjZ;

GLdouble ModelViewMatrix;

glGetDoublev(GL_MODELVIEW_MATRIX,&ModelViewMatrix);

GLdouble ProjectionMatrix;

glGetDoublev(GL_PROJECTION_MATRIX,&ProjectionMatrix);

GLint ViewPort;

glGetIntegerv(GL_VIEWPORT,&ViewPort);

gluUnProject(Myska.Xpos,Myska.Ypos,1.0,ModelViewMa trix,ProjectionMatrix,ViewPort,&ObjX,&ObjY,&ObjZ);