1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<TITLE>GDSetCurrentMtx</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GDSetCurrentMtx</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><CODE>#include &lt;revolution/gd.h&gt;</CODE></PRE>
16  <DD>
17<PRE>void GDSetCurrentMtx ( u32 pn, u32 t0, u32 t1, u32 t2, u32 t3,
18u32 t4, u32 t5, u32 t6, u32 t7 );</PRE>
19</DL>
20<H2>Arguments</H2>
21<TABLE border="1" cellpadding="3" cellspacing="0.1">
22  <TBODY>
23    <TR>
24<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>pn</CODE></EM></STRONG></FONT></STRONG></EM></TD>
25<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXPosNrmMtx.html">index</a> to use for the position/normal matrix.</TD>
26    </TR>
27    <TR>
28<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t0</CODE></EM></STRONG></FONT></STRONG></EM></TD>
29<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 0.</TD>
30    </TR>
31    <TR>
32<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t1</CODE></EM></STRONG></FONT></STRONG></EM></TD>
33<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 1.</TD>
34    </TR>
35    <TR>
36<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t2</CODE></EM></STRONG></FONT></STRONG></EM></TD>
37<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 2.</TD>
38    </TR>
39    <TR>
40<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t3</CODE></EM></STRONG></FONT></STRONG></EM></TD>
41<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 3.</TD>
42    </TR>
43    <TR>
44<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t4</CODE></EM></STRONG></FONT></STRONG></EM></TD>
45<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 4.</TD>
46    </TR>
47    <TR>
48<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t5</CODE></EM></STRONG></FONT></STRONG></EM></TD>
49<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 5.</TD>
50    </TR>
51    <TR>
52<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t6</CODE></EM></STRONG></FONT></STRONG></EM></TD>
53<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 6.</TD>
54    </TR>
55    <TR>
56<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><CODE><STRONG><EM><CODE>t7</CODE></EM></STRONG></FONT></STRONG></EM></TD>
57<TD width="520">Specifies the matrix <a href="../gx/Enumerated_Types/GXTexMtx.html">index</a> to use for texture coordinate 7.</TD>
58    </TR>
59  </TBODY>
60</TABLE>
61<H2>Return Values</H2>
62<P>None.</P>
63<H2>Description</H2>
64<P>This&nbsp;function sets the current matrix parameters for both the position/normal matrix as well as all of the texture coordinate transformation matrices.&nbsp;</P>
65<P>The matrix <STRONG><EM><CODE>pn</CODE></EM></STRONG> 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 <a href="../gx/Geometry/GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>). If <CODE>GX_VA_PNMTXIDX</CODE> is enabled by the current vertex descriptor, the matrix <STRONG><EM><CODE>pn</CODE></EM></STRONG> specified by <code>GDSetCurrentMtx</code> will be overwritten by the indices specified as vertices.</P>
66<P>Similarly, if the vertex data does not have a texture matrix index that corresponds to each vertex, matrices <STRONG><EM><CODE>t0</CODE></EM></STRONG>- <STRONG><EM><CODE>t7</CODE></EM></STRONG> 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 <code>GDSetCurrentMtx</code>.</P>
67<P>Specify the values enumerated by <a href="../gx/Enumerated_Types/GXPosNrmMtx.html"><code>GXPosNrmMtx</code></a> for the given position coordinate matrix index/normal matrix index. Specify the values enumerated by <a href="../gx/Enumerated_Types/GXTexMtx.html"><CODE>GXTexMtx</CODE></a> for the given texture matrix index. For every instance, the <a href="../gx/Management/GXInit.html"><code>GXInit</code></a> function sets <code>GX_PNMTX0</code> as the default position coordinate index/normal matrix and <CODE>GX_IDENTITY</CODE> as the default texture coordinate transformation matrix.</P>
68<P>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.&nbsp;Position matrix rows beyond the first 32 rows will wrap around to reference the corresponding normal matrix rows.&nbsp;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.</P>
69<H2>See Also</H2>
70<P><A href="../gx/Transform/GXSetCurrentMtx.html"><CODE>GXSetCurrentMtx</CODE></A><BR> <A href="../gx/TexCoordGen/GXSetTexCoordGen.html"><CODE>GXSetTexCoordGen</CODE></A><BR> <CODE><A href="../gx/Transform/GXLoadNrmMtxImm.html">GXLoadNrmMtxImm</A></CODE><BR> <A href="../gx/Transform/GXLoadNrmMtxIndx3x3.html"><CODE>GXLoadNrmMtxIndx3x3</CODE></A><BR> <A href="../gx/Transform/GXLoadPosMtxImm.html"><CODE>GXLoadPosMtxImm</CODE></A><BR> <A href="../gx/Transform/GXLoadPosMtxIndx.html"><CODE>GXLoadPosMtxIndx</CODE></A><BR> <A href="../gx/Transform/GXLoadTexMtxImm.html"><CODE>GXLoadTexMtxImm</CODE></A><BR> <A href="../gx/Transform/GXLoadTexMtxIndx.html"><CODE>GXLoadTexMtxIndx</CODE></A></P>
71<P>(and corresponding <a href="gdgx.html">GD</a> functions)</P>
72<H2>Revision History</H2>
73<P>03/01/2006 Initial version.</P>
74</BODY>
75</HTML>