Projection Transformation

The orthographic volume function is actually a transformation.



Translations, rotations, and scales are called ModelView transformations - they manipulate models. i.e. they move objects around in space.

glOrtho is a Projection transformation. It converts (x, y, z) points from your "modeling" space to points in a projection space.
Points in this space are used to create the final 2D image (a projection of the 3D geometry).







glMatrixMode switches between ModelView and Projection modes, when defining transformations.

It's best to leave the mode as ModelView by default.
e.g.:

glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(-10, 10, -10, 10, 0, 20)
glMatrixMode(GL_MODELVIEW)

glLoadIdentity()
glTranslate(5, 0, 0)





next