guPerspective
Creates a perspective projection matrix (fixed point)
#include <ultra64.h> /* gu.h */
void guPerspective(
Mtx *m,
u16 *perspNorm,
float fovy,
float aspect,
float near,
float far,
float scale);
None.
Returns a perspective projection matrix to the structure indicated by m, and returns a numerical value to perspNorm for use by gSPPerspNormalize. When this function is called, the result is the creation of the following kind of projection matrix:
Both near and far must be positive values. This function specifies the viewable region of the perspective transformation (the viewing volume), which is shaped like a square-based pyramid with its top cut off. With this function, the pyramid has bilateral symmetry, whereas with guFrustum you can define a pyramid that does not have bilateral symmetry. For details about the fixed-point format, see gSPMatrix. Floating point is handled with the guPerspectiveF function.
The Mtx structure looks like this:
typedef long Mtx_t[4][4];
typedef union {
Mtx_t m;
long long int force_structure_alignment;
} Mtx;
gSPMatrix, gSPPerspNormalize, guFrustum, guFrustumF, guOrtho, guOrthoF, and guPerspectiveF
03/01/99 Completely rewritten.