Geometry Transformation Pipeline
To create an image of a 3D scene, OpenGL has to go through several steps, starting with a set of vertices that define a form, and ending with many forms placed together in a scene that has a viewpoint, width, height and depth and appears on a computer screen. These steps, called the "Transformation Pipeline" map the geometry from one "space" to another. For instance several 3D models, each centered at the origin, may be mapped by glTranslate() into a "world space" where each model has a position relative to the world space origin. Below is a summary of the steps in the Transformation Pipeline. 1) Make the geometry define shapes build geometry in the "model space" (or "object space") vertices are typically centered at the origin functions: glBegin() glVertex() glEnd() 2) Position the geometry define camera and geometry positions place geometry in the "world space" and the "eye space" vertices have new coordinates relative to the world origin vertices are positioned relative to the eye (gluLookAt) the MODELVIEW matrix functions: gluLookat() glTranslate() glRotate() glScale() 3) Project the geometry define camera lens place geometry in the viewing volume aka the "clip space" the PROJECTION matrix functions: gluPerspective() glFrustum() glOrtho() 4) position the rendering on screen define the shape and position of the rendering place geometry in the "screen space" the Viewport is not a matrix (array of four numbers: x,y,w,h) functions: glViewport()