Gl.Ortho (gb.opengl)

Static Sub Ortho ( Left As Float, Right As Float, Bottom As Float, Top As Float, Near As Float, Far As Float )

Multiply the current matrix with an orthographic matrix.

Parameters

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.
nearVal, farVal

Specify the distances to the nearer and farther depth clipping planes. These values are negative if the plane is to be behind the viewer.

Description

Gl.Ortho describes a transformation that produces a parallel projection. The current matrix (see Gl.MatrixMode) 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:

2 right - left 0 0 t x 0 2 top - bottom 0 t y 0 0 -2 farVal - nearVal t z 0 0 0 1

where t x - right + left right - left

t y - top + bottom top - bottom

t z - farVal + nearVal farVal - nearVal

Typically, the matrix mode is Gl.PROJECTION, and left bottom - nearVal and right top - nearVal 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). - farVal specifies the location of the far clipping plane. Both nearVal and farVal can be either positive or negative.

Use Gl.PushMatrix and Gl.PopMatrix to save and restore the current matrix stack.

Errors

Gl.INVALID_VALUE is generated if left = right, or bottom = top, or near = far.

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.COLOR_MATRIX

Gl.Get with argument Gl.MODELVIEW_MATRIX

Gl.Get with argument Gl.PROJECTION_MATRIX

Gl.Get with argument Gl.TEXTURE_MATRIX

See also

See original documentation on OpenGL website