[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glOrtho Subroutine

Purpose

Multiplies the current matrix by an orthographic matrix.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glOrtho(GLdouble Left, 
    GLdouble Right,
    GLdouble Bottom, 
    GLdouble Top,
    GLdouble Near, 
    GLdouble Far)

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.
Near, Far Specify the distances to the nearer and farther depth clipping planes. These distances are negative if the plane is to be behind the viewer.

Description

The glOrtho subroutine describes a perspective matrix that produces a parallel projection. (Left, Bottom, -Near) and (Right, Top, -Near) 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). -Far specifies the location of the far clipping plane. Both Near and Far can be either positive or negative. The corresponding matrix is as follows:

where the following statements apply:

The current matrix is multiplied by this matrix with the result replacing the current matrix. That is, if M is the current matrix and O is the ortho matrix, M is replaced with MO.

Use the glPushMatrix and glPopMatrix subroutines to save and restore the current matrix stack.

Errors

GL_INVALID_OPERATION The glOrtho subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glOrtho subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_MATRIX_MODE

glGet with argument GL_MODELVIEW_MATRIX

glGet with argument GL_PROJECTION_MATRIX

glGet with argument GL_TEXTURE_MATRIX.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin or glEnd subroutine, glFrustum subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine, glViewport subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]