guOrtho.3p 1.71 KB
.TH guOrtho 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
guOrtho, guOrthoF \- computes a orthographic projection matrix.
.SH C SPECIFICATION
.nf
\f3#include "gu.h"

void guOrtho(Mtx m, float l, float r, float b, float t,
	float n, float f, float scale)

void guOrthoF(float m[4][4], float l, float r, float b, float t,
	float n, float f, float scale)
\fP
.fi
.SH PARAMETERS
.TP 10
.I m
resulting 4x4 projection matrix.
.TP
.I l, r
left and right vertical clipping planes.
.TP
.I b, t
bottom and top horizontal clipping planes.
.TP
.I n, f
the near and far clipping planes (z-planes in world space).
.TP
.I scale
scale each element of the matrix.
Can be used to improve precision in the RSP fixed point arithmetic.
.SH DESCRIPTION
This command creates a matrix for an orthographic parallel
viewing volume. The near clipping plane is a rectangle
with the lower left corner at 
.B (l, b, -n)
and the upper right corner at
.B (r, t, -n).
The far clipping plane is a rectangle with corners at
.B (l, b, -f)
and
.B (r, t, -f).
Both near and far
.B (n and f)
can be positive or negative.
.I guOrtho
returns a fixed point 4x4 matrix 
.B m.
For a detailed description of the 
fixed-point matrix format, see
.I gSPMatrix (3P).
.PP
.I guOrthoF
returns a floating-point 4x4 matrix 
.B m.
.SH NOTE
The near and far planes are specified slightly differently here
than they are in the
.IR guPerspective (3P)
command. In this command, they represent z-planes in world space;
in
.IR guPerspective (3P)
they are distances which are always positive.

Larger separations between the near and far planes decrease
the z resolution for z-buffering.

.SH SEE ALSO
.IR guFrustum (3P),
.IR guPerspective (3P),
.IR guLookAt (3P),
.IR gSPMatrix (3P),
.IR glOrtho (3G)