
Originally Posted by
crazyfuturamanoob
I don't like the retarded 3D coordinate system of OpenGL. I never get used to it.
I want to change it to like this:
In the picture, Z gets larger at near, and XY coords are similar to 2D, like in GIMP.
But I still want to keep 3d perspective and depth testing. How is this done?
And I also want to make the units smaller, like 50.0 matching ~50-60 pixels.
With default settings, 50.0 will be far outside screen.
Invert the Y and Z acsiss of your coordinate system before passing to OpenGL.
It is not possible to make the coordinates equal to some pixel value unless you are using an orthographic projection, in which case you can:
Code:
float proj_bot = 0 - (screen_res.Y / 2);
float proj_top = 0 + (screen_res.Y / 2);
float proj_lef = 0 - (screen_res.X / 2);
float proj_rig = 0 + (screen_res.X / 2);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(proj_lef, proj_rig, proj_bot, proj_top, 0.1, 200.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();