guOrtho

guOrtho [Function]

Function

guOrtho

Creates an orthogonal projection matrix (fixed point)

Syntax

#include <ultra64.h>        /* gu.h */
void guOrtho(
        Mtx *m,
        float l,
        float r,
        float b,
        float t,
        float n,
        float f,
        float scale);

Arguments

m
Pointer to 4x4 projection matrix resulting from calculation
l
Near plane's lower-left x coordinate
r
Near plane's upper-right x coordinate
b
Near plane's lower-left y coordinate
t
Near plane's upper-right y coordinate
n
z-coordinate of near clipping plane
f
z-coordinate of far clipping plane
scale
Scale for matrix elements
* Can be used to set the significant number of digits for RSP fixed-point computations.

Returned value

None

Description

Returns an orthogonal projection matrix to the structure specified by m for a parallel view of the orthogonal projection. When this function is called, the result is the creation of the following kind of projection matrix:

The near clipping plane is a rectangle with the lower-left vertex at (l, b, -n) and the upper-right vertex at (r, t, -n). The far clipping plane is a rectangle with the lower-left vertex at (l, b, -f) and the upper-right vertex at (r, t, -f). Both near and far (n and f) can take either positive or negative values. For details about the fixed-point format, see gSPMatrix. Floating point is handled with the guOrthoF function.

Note

In this function, the near plane and far plane are proportionate with the z plane in the world coordinate system, which differs from the specifications made with guPerspective. In the case of guPerspective, distances are always specified using positive values. Also, the resolution of the Z buffer declines as the distance between the near plane and far plane increases.

Comment

The Mtx structure looks like this:

typedef long  Mtx_t[4][4];
typedef union {
     Mtx_t          m;
     long long int  force_structure_alignment;
} Mtx;

See also

gSPMatrix, guFrustum, guFrustumF, guLookAt, guLookAtF, guOrthoF, guPerspective, and guPerspectiveF

Revision history

03/01/99 Completely rewritten.