guLookAtStereo

guLookAtStereo [Function]

Function

guLookAtStereo

Creates a viewing matrix (fixed point)

Syntax

#include <ultra64.h>        /* gu.h */
void guLookAtStereo(
        Mtx *m,
        float xEye,
        float yEye,
        float zEye,
        float xAt,
        float yAt,
        float zAt,
        float xUp,
        float yUp,
        float zUp,
        float eyedist);

Arguments

m
Pointer to matrix resulting from calculation
xEye
x-coordinate of viewpoint
yEye
y-coordinate of viewpoint
zEye
z-coordinate of viewpoint
xAt
x-coordinate of lookat point
yAt
y-coordinate of lookat point
zAt
z-coordinate of lookat point
xUp
x component of upward vector
yUp
y component of upward vector
zUp
z component of upward vector
eyedist
Distance from viewpoint to "eye"
* Positive value is for "right eye" and negative value is for "left eye"

Returned value

None.

Description

Returns a viewing matrix for stereographics to the structure indicated by m. For details about the fixed-point format, see gSPMatrix. Floating point can be handled with the guLookAtStereoF function.

Note

Calling this function one time returns the matrix for one "eye," so you normally need to call this function twice, once for the "right eye" and once for the "left eye." Unlike guLookAt, with this function you need the distance from the viewpoint (xEye, yEye, zEye) to the lookat point (xAt, yAt, zAt). The lookat point must be specified as the focal point of both eyes.

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, guLookAtStereoF

Revision history

03/01/99 Completely rewritten.