2.0 3.0 > comp > gb.opengl > gl > ortho
Previous  Next  Edit  Rename  Undo  Search  Administration
 Documentation
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:

$\left(\begin{array}{cccc}\frac{2}{\mathit{right}-\mathit{left}}& 0& 0& {\mathit{t}}_{\mathit{x}}\\ 0& \frac{2}{\mathit{top}-\mathit{bottom}}& 0& {\mathit{t}}_{\mathit{y}}\\ 0& 0& \frac{-2}{\mathit{farVal}-\mathit{nearVal}}& {\mathit{t}}_{\mathit{z}}\\ 0& 0& 0& 1\end{array}\right)$

where ${\mathit{t}}_{\mathit{x}}=-\frac{\mathit{right}+\mathit{left}}{\mathit{right}-\mathit{left}}$

${\mathit{t}}_{\mathit{y}}=-\frac{\mathit{top}+\mathit{bottom}}{\mathit{top}-\mathit{bottom}}$

${\mathit{t}}_{\mathit{z}}=-\frac{\mathit{farVal}+\mathit{nearVal}}{\mathit{farVal}-\mathit{nearVal}}$

Typically, the matrix mode is Gl.PROJECTION, and $\left(\mathit{left},\mathit{bottom},-\mathit{nearVal}\right)$ and $\left(\mathit{right},\mathit{top},-\mathit{nearVal}\right)$ 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). $-\mathit{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