The process of producing a target scene is similar to taking a picture with a camera:
(1) Secure the camera to the tripod and let him view the scene from a different location in the scene ( views transform )
Glulookat
(2) Arranging the scene so that the position of each object in the photo is what we want to move, rotate or enlarge the object in the scene ( model transformation )
gltranslate*, glrotate*, glscale*
(3) Select the camera lens and adjust the magnification (focus) Display object, you can choose how the object is projected onto the screen ( projection transformation )
glfrustum, gluperspective, Glortho
(4) Determine the size of the photo, enlarge the photo or reduce the photo to draw down the picture, is to occupy the entire screen or part of the screen ( viewport transformation )
Glviewport
Note: The view transform must appear before the model transformation, but you can perform a projection transform and a viewport transform at any time before the drawing.
If OpenGL does not set the model, projection, viewport, the coordinates of the plotted geometry can only be 1 to 1 (the x-axis to the right, the y-axis upward, and the z-axis vertical screen).
The default is the view model change glmatrixmode(gl_modelview);
Default projection transform to Glortho
OpenGL view transformations, model transformations, projection transformations, viewport transformations