glOrtho.3   [plain text]


'\" e  
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp May 22 14:46
.ds Dm 8 May 22 14:
.ds Xs 02001     5
.TH GLORTHO 3G
.SH NAME
.B "glOrtho
\- multiply the current matrix with an orthographic matrix

.SH C SPECIFICATION
void \f3glOrtho\fP(
GLdouble \fIleft\fP,
.nf
.ta \w'\f3void \fPglOrtho( 'u
	GLdouble \fIright\fP,
	GLdouble \fIbottom\fP,
	GLdouble \fItop\fP,
	GLdouble \fIzNear\fP,
	GLdouble \fIzFar\fP )
.fi

.SH PARAMETERS
.TP \w'\f2left\fP\ \f2right\fP\ \ 'u 
\f2left\fP, \f2right\fP
Specify the coordinates for the left and right vertical clipping planes.
.TP
\f2bottom\fP, \f2top\fP
Specify the coordinates for the bottom and top horizontal clipping planes.
.TP
\f2zNear\fP, \f2zFar\fP
Specify the distances to the nearer and farther depth clipping planes.
These values are negative if the plane is to be behind the viewer.
.SH DESCRIPTION
\%\f3glOrtho\fP describes a transformation that produces a parallel projection.
The current matrix (see \%\f3glMatrixMode\fP) is multiplied by this matrix
and the result replaces the current matrix, as if
\%\f3glMultMatrix\fP were called with the following matrix
as its argument:
.sp
.ce
.EQ
left (  matrix {
   ccol { {2 over {"right" - "left"}} above 0 above 0 above 0 }
   ccol { 0 above {2 over {"top" - "bottom"}} above 0 above 0 }
   ccol { 0 above 0 above {-2 over {"zFar" - "zNear"}}  above 0 }
   ccol { {t sub x}~ above {t sub y}~ above {t sub z}~ above 1~ }
} right )
.EN
.BP
.P
where
.ce
.EQ
t sub x ~=~ -^{{"right" ~+~ "left"} over {"right" ~-~ "left"}}
.EN

.ce
.EQ
t sub y ~=~ -^{{"top" ~+~ "bottom"} over {"top" ~-~ "bottom"}}
.EN

.ce
.EQ
t sub z ~=~ -^{{"zFar" ~+~ "zNear"} over {"zFar" ~-~ "zNear"}}
.EN

.RE
.P
Typically, the matrix mode is \%\f3GL_PROJECTION\fP, and 
(\f2left\fP, \f2bottom\fP,  \-\f2zNear\fP) and (\f2right\fP, \f2top\fP,  \-\f2zNear\fP)
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).
\-\f2zFar\fP specifies the location of the far clipping plane.
Both \f2zNear\fP and \f2zFar\fP can be either positive or negative.
.P
Use \%\f3glPushMatrix\fP and \%\f3glPopMatrix\fP to save and restore
the current matrix stack.
.SH ERRORS
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glOrtho\fP
is executed between the execution of 
\%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_MATRIX_MODE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_COLOR_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MODELVIEW_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_PROJECTION_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_TEXTURE_MATRIX\fP
.SH SEE ALSO
\%\f3glFrustum\fP,
\%\f3glMatrixMode\fP,
\%\f3glMultMatrix\fP, 
\%\f3glPushMatrix\fP,
\%\f3glViewport\fP