I find the normalized, centralized coordinate system used in OpenGL weird and annoying, is there anything I can do at all to make it work like normal pixel coordinates on everything ever except OpenGL? And yes, of course I Googled it.
EDIT: I'm using OpenGL 2.1
Answer
glOrtho( 0.f, viewWidth, viewHeight, 0.f, 0.f, 1.f );
Assuming that you're starting from an identity matrix, this glOrtho() call will give you a traditional window coordinate system with 0,0 at the top left corner, such that one unit in OpenGL space corresponds exactly to one pixel in the view which contains the OpenGL-rendered image.
No comments:
Post a Comment