PDA

View Full Version : viewport coordinates



Sabonis
08-28-2008, 09:14 AM
If I have something like this:
glBegin(GL_POINTS);
glVertex3f(x,y,z);
glEnd();


How can I obtain the correspondent coordinates X,Y on the screen?

Rosario Leonardi
08-28-2008, 04:07 PM
You can use the gluunproject
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/unproject.html

Or make the computation by hand, you have to invert the projection and model matrix.