guLookAtHiliteF

guLookAtHiliteF [Function]

Function

guLookAtHiliteF

Creates the viewing matrix (floating point) and sets the LookAt/Hilite structures

Syntax

#include <ultra64.h>        /* gu.h */
void guLookAtHiliteF(
        float mf[4][4],
        LookAt *l,
        Hilite *h,
        float xEye,
        float yEye,
        float zEye,
        float xAt,
        float yAt,
        float zAt,
        float xUp,
        float yUp,
        float zUp,
        float xl1,
        float yl1,
        float zl1,
        float xl2,
        float yl2,
        float zl2,
        int twidth,
        int theight);

Arguments

mf
4x4 viewing matrix resulting from calculation
l
Pointer to LookAt structure resulting from calculation
h
Pointer to Hilite 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
xl1
x direction for first specular highlight
yl1
y direction for first specular highlight
zl1
z direction for first specular highlight
xl2
x direction for second specular highlight
yl2
y direction for second specular highlight
zl2
z direction for second specular highlight
twidth
Width of texture for specular highlight
theight
Height of texture for specular highlight

Returned value

None

Description

This function returns a viewing matrix to mf. It also sets the x,y screen coordinate directions in the LookAt structure in order to render specular highlights, and it sets the texture offsets used for the rendering of two specular highlights in the Hilite structure. Fixed point is handled with the guLookAtHilite function.

The arguments that this function shares in common with guLookAtF also share the same meanings. Use gDPSetHilite1Tile or gDPSetHilite2Tile to set the texture parameters (the Hilite structure) for the rendering of specular highlights. Use the gSPLookAt function to set the texture settings (the LookAt structure) for specular highlights.

For details, see Section 11.7.4 "Specular Highlights" in the N64 Programming Manual.

Note

If you are only going to render one specular highlight, be sure to set xl2, yl2, and zl2 to 0. Also, note that both twidth and theight must be powers of 2.

Comment

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.

The Hilight structure looks like this:

typedef struct {
     int       x1, y1, x2, y2; /* Texture offsets for specular highlights  */
} Hilite_t;
typedef union {
     Hilite_t  h;
     long int  force_structure_alignment[4];
} Hilite;

See also

gDPSetHilite1Tile, gDPSetHilite2Tile, gSPLookAt, guLookAt, guLookAtF, guLookAtHilite, guLookAtReflect, and guLookAtReflectF

Revision history

03/01/99 Completely rewritten.