Name
gl.Ortho -- multiply the current matrix with an orthographic matrix
Synopsis
gl.Ortho(left, right, bottom, top, zNear, zFar)
Function
gl.Ortho() describes a transformation that produces a parallel projection. The current matrix (See gl.MatrixMode for details.) is multiplied by this matrix and the result replaces the current matrix, as if gl.MultMatrix() were called with the following matrix as its argument:

 
A 0 0 tx
0 B 0 ty
0 0 C tz
0 0 0 1

where

 
A = 2 / (right - left)
B = 2 / (top - bottom)
C = -2 / (far  - near)
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 (0, 0, 0). -zFar specifies the location of the far clipping plane. Both zNear and zFar can be either positive or negative.

Use gl.PushMatrix() and gl.PopMatrix() to save and restore the current matrix stack.

Please consult an OpenGL reference manual for more information.

Inputs
left
specify the coordinate for the left vertical clipping plane
right
specify the coordinate for the right vertical clipping plane
bottom
specify the coordinate for the bottom horizontal clipping plane
top
specify the coordinate for the top horizontal clipping plane
zNear
specify the distance to the nearer depth clipping plane; this value is negative if the plane is to be behind the viewer
zFar
specify the distance to the farther depth clipping plane; this value is negative if the plane is to be behind the viewer
Errors
#GL_INVALID_VALUE is generated if left = right, or bottom = top, or zNear = zFar.

#GL_INVALID_OPERATION is generated if gl.Ortho() is executed between the execution of gl.Begin() and the corresponding execution of gl.End().

Associated gets
gl.Get() with argument #GL_MATRIX_MODE

gl.Get() with argument #GL_MODELVIEW_MATRIX

gl.Get() with argument #GL_PROJECTION_MATRIX

gl.Get() with argument #GL_TEXTURE_MATRIX


Show TOC