Function glOrtho

  • glOrtho describes a transformation that produces a parallel projection. The current matrix (see glMatrixMode) is multiplied by this matrix and the result replaces the current matrix, as if glMultMatrix were called with the following matrix as its argument:

    ⎛2 / right-leftㅤㅤ ㅤㅤ0ㅤㅤㅤㅤㅤㅤㅤ ㅤ ㅤ0ㅤㅤㅤㅤㅤㅤㅤ𝐭ₓ⎞

    ⎜0ㅤㅤㅤㅤㅤㅤ2 / top - bottomㅤㅤㅤㅤㅤㅤ0ㅤㅤㅤㅤㅤㅤㅤ𝐭ᵧ ⎜

    ⎜0ㅤㅤㅤㅤㅤㅤㅤ ㅤ ㅤ0ㅤㅤㅤㅤㅤ-2 / farVal - nearValㅤㅤㅤ𝐭𝑧 ⎜

    ⎝0ㅤㅤㅤㅤㅤㅤㅤ ㅤ ㅤ0ㅤㅤㅤㅤㅤㅤ ㅤ ㅤ ㅤ0ㅤㅤㅤㅤㅤㅤ ㅤ1⎠

    where

    𝐭ₓ = − right + left / right − left

    𝐭ᵧ = − top + bottom / top − bottom

    𝐭𝑧 = − 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 glPushMatrix and glPopMatrix to save and restore the current matrix stack.

    Parameters

    • left: number

      Specifies the coordinate for the left vertical clipping plane.

    • right: number

      Specifies the coordinate for the right vertical clipping plane.

    • bottom: number

      Specifies the coordinate for the bottom horizontal clipping plane.

    • top: number

      Specifies the coordinate for the top horizontal clipping plane.

    • nearVal: number

      Specifies the distance to the nearer depth clipping plane. This value is negative if the plane is to be behind the viewer.

    • farVal: number

      Specifies the distance to the farther depth clipping plane. This value is negative if the plane is to be behind the viewer.

    Returns void

    Summary

    multiply the current matrix with an orthographic matrix

    See

    glOrtho

Generated using TypeDoc