guLookAtReflect

guLookAtReflect [Function]

Function

guLookAtReflect

Creates the viewing matrix (fixed point) and sets the LookAt structure

Syntax

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

Arguments

m
Pointer to matrix resulting from calculation
l
Pointer to LookAt structure 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

Returned value

None

Description

This function returns a viewing matrix to the structure indicated by m. It also sets the x,y screen coordinate directions in the LookAt structure for reflection mapping. For a detailed explanation about the fixed point format, see gSPMatrix. Floating point is handled with the guLookAtReflectF function.

Use gSPLookAt to set the texture settings (LookAt structure) for reflection mapping.

For details, see Section 11.7.5 "Reflection Mapping" in the N64 Programming Manual.

Note

The Mtx structure looks like this:

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

The LookAt structure looks like this:

typedef  struct {
     unsigned char  col[3]; /* Diffuse light value (RGBA) */
     char           pad1;
     unsigned char  colc[3]; /* Copy of diffuse light value (RGBA)*/
     char           pad2;
     signed char    dir[3]; /* Direction toward light source (normalized) */
     char           pad3;   /* IMPORTANT: dir must be smaller than 127 */
} Light_t;
typedef union {
     Light_t        l;
     long long int  force_structure_alignment[2];
} Light;
typedef struct {
     Light          l[2];
} LookAt;
* Note that here the Light structure is not utilized in the normal way: l[0].dir is for the x,y,z components of the viewing space in the x direction of the screen space, while l[1].dir is for the x,y,z components of the viewing space in the y direction of the screen space.

See also

gSPLookAt, gSPMatrix, guLookAt, guLookAtF, guLookAtHilite, guLookAtHiliteF, and guLookAtReflectF

Revision history

03/01/99 Completely rewritten.