To main page | 3dengine.org

Flipping axes


It is often desirable to change the direction of axes in OpenGL. This can be achieved via glScale and glRotate calls.

For example to make z-axis go into the screen, instead of going into the user, use:
glScalef(0,0,-1)
To make XY flat plane and Z going up, use:
glRotatef(-90,0,0,1)
glRotatef(-90,0,1,0)