GDSetCurrentMtx

C Specification

#include <revolution/gd.h>
void GDSetCurrentMtx ( u32 pn, u32 t0, u32 t1, u32 t2, u32 t3,
u32 t4, u32 t5, u32 t6, u32 t7 );

Arguments

pn Specifies the matrix index to use for the position/normal matrix.
t0 Specifies the matrix index to use for texture coordinate 0.
t1 Specifies the matrix index to use for texture coordinate 1.
t2 Specifies the matrix index to use for texture coordinate 2.
t3 Specifies the matrix index to use for texture coordinate 3.
t4 Specifies the matrix index to use for texture coordinate 4.
t5 Specifies the matrix index to use for texture coordinate 5.
t6 Specifies the matrix index to use for texture coordinate 6.
t7 Specifies the matrix index to use for texture coordinate 7.

Return Values

None.

Description

This function sets the current matrix parameters for both the position/normal matrix as well as all of the texture coordinate transformation matrices. 

The matrix pn is used to select the current model view and normal transformation matrix if a position coordinate matrix or normal matrix index is not present in the vertex data (see GXSetVtxDesc). If GX_VA_PNMTXIDX is enabled by the current vertex descriptor, the matrix pn specified by GDSetCurrentMtx will be overwritten by the indices specified as vertices.

Similarly, if the vertex data does not have a texture matrix index that corresponds to each vertex, matrices t0- t7 will be used to select the current texture coordinate transformation matrix for texture coordinates 0 - 7, respectively. A vertex level texture matrix index will overwrite the corresponding matrix specified by GDSetCurrentMtx.

Specify the values enumerated by GXPosNrmMtx for the given position coordinate matrix index/normal matrix index. Specify the values enumerated by GXTexMtx for the given texture matrix index. For every instance, the GXInit function sets GX_PNMTX0 as the default position coordinate index/normal matrix and GX_IDENTITY as the default texture coordinate transformation matrix.

Note that matrix indices correspond to rows in matrix memory. While the position matrix memory has 64 rows (shared with regular texture matrices), the normal matrix memory has only 32 rows. Position matrix rows beyond the first 32 rows will wrap around to reference the corresponding normal matrix rows. Therefore, a position coordinate and normal matrix index value of 48 indicates row 48 in the position matrix memory and row 16 in the normal matrix memory.

See Also

GXSetCurrentMtx
GXSetTexCoordGen
GXLoadNrmMtxImm
GXLoadNrmMtxIndx3x3
GXLoadPosMtxImm
GXLoadPosMtxIndx
GXLoadTexMtxImm
GXLoadTexMtxIndx

(and corresponding GD functions)

Revision History

03/01/2006 Initial version.