I find the OpenGL Co-ordinate system really hard to use. I would much rather have things like glVertex2f(-100,-100) put a vertex back 100 pixels in the X and Y direction from the origin, instead of it being totally off the screen. Is there any way that I can do this? I was thinking mabey just glTranslate’ing out in the Z direction but I am not sure if this will work.
If you want to use pixel coordinates, use the correct projection, like for example :
glOrtho(0, WindowWidthInPixels, 0, WindowHeightInPixels, -1, 1);
Thanks for your answer.
When I use that method, the origin (0,0) seems to be at the bottom left corner of the screen. Is there anyway to make it the top right? I don’t really understand the left, right, top, bottom paramaters.
With GL u decide what to do. As pointed out by ZBuffer set the appropriate projection matrix and u will have what u want.
Top right ? This is unusual.
left, right, top, bottom paramaters define the range of GL coordinates visible on the glViewPort. So reverse order to reverse axes, like :