void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
left, right | Specify the coordinates for the left and right vertical clipping planes. |
bottom, top | Specify the coordinates for the bottom and top horizontal clipping planes. |
zNear, zFar | Specify the distances to the nearer and farther depth clipping planes. These values are negative if the plane is to be behind the viewer. |
| | 2 / (right - left | 0 | 0 | tx | | |
| | 0 | (2 / (top - bottom) | 0 | ty | | |
| | 0 | 0 | (-2 / (zFar - zNear) | tz | | |
| | 0 | 0 | 0 | 1 | | |
where
tx = - (right + left) / (right - left)
ty = - (top + bottom) / (top - bottom)
tz = - (zFar + zNear) / (zFar - zNear)
Typically, the matrix mode is GL_PROJECTION, and (left,
bottom, -zNear) and (right, top, -zNear)
specify the points on the near clipping plane that are mapped to the
lower left and upper right corners of the window, respectively, assuming
that the eye is located at
Use glPushMatrix and glPopMatrix to save and restore the current matrix stack.