guPerspective.3p 1.35 KB
.TH guPerspective 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
guPerspective, guPerspectiveF \- computes a perspective projection matrix.
.SH C SPECIFICATION
.nf
\f3#include "gu.h"

void guPerspective(Mtx m, u16 *perspNorm,
		float fovy, float aspect,
		float near, float far, float scale)

void guPerspectiveF(float m[4][4], u16 *perspNorm,
		float fovy, float aspect,
		float near, float far, float scale)

\fP
.fi
.SH PARAMETERS
.TP 10
.I m
resulting 4x4 projection matrix.
.TP
.I perspNorm
value to use with the
.I gSPPerspNormalize
command.
.TP
.I fovy
field of view angle, in degrees, in the y direction.
.TP
.I aspect
aspect ratio that determines the field of view in the x direction.
The aspect ratio is the ratio of x (width) to y (height) of the 
viewport region.
.TP
.I near, far
distance from the viewer to the near and far clipping plane (always positive).
.TP
.I scale
scale each element of the matrix.
Can be used to improve precision in the RSP fixed-point arithmetic.
.SH DESCRIPTION
.I guPerspective
returns a fixed-point 4x4 matrix 
.B m 
and a number to use with
.I gSPPerspNormalize.
.PP
For a detailed description of the 
fixed-point matrix format, see
.I gSPMatrix (3P).
.PP
.I guPerspectiveF
returns a floating-point 4x4 matrix 
.B m.

.SH SEE ALSO
.IR guFrustum (3P)
.IR guOrtho (3P)
.IR gSPMatrix (3P)
.IR gSPPerspNormalize (3P)
.IR gluPerspective (3G)