PDA

View Full Version : From Pixelbuffer to Primitiv



Jeff_Mills
10-15-2004, 03: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

thx
nicolas

-NiCo-
10-15-2004, 04: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.

Nico