View Full Version : From Pixelbuffer to Primitiv

10-15-2004, 02:14 AM
does anybody know if their is a possibility to go the graphic pipeline backwards?
Following problem:

Given a pixel (x,y) of the current pixel buffer.
Retrieve its primitiv coordinate after projection or even better in worldview coordinates.

I hope someone can give me hints for this problem


10-15-2004, 03:16 AM
int gluUnProject( GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz );

The format of these arguments is the same as if they were obtained from glGetDoublev and glGetIntegerv.

note: when using glut mouse function, winy starts from the top while in opengl winy starts from the bottom of the screen.