PDA

View Full Version : Pixel in opengl



luisguerrero18
01-15-2003, 12:43 AM
I wanted to know to the correspondence between the pixels of Windows and the values of opengl. Because when i made clic on the window i get de X coordinate of the window and the Y coordinate, but i have to know the coordinate in opengl, I used a 900*600 window and 2d opengl pixel format without perspective. thankx.

Relic
01-15-2003, 12:57 AM
You can use gluUnProject for that.
Note that Windows' coordinates use a top-left origin and OpenGL uses bottom-left.
Your mouse y-coordinate needs to be inverted.