1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>GXLoadPosMtxIndx</title> 10</head> 11 12<body> 13 14<h1 align="left">GXLoadPosMtxIndx</h1> 15 16<h2>C Specification</h2> 17 18<dl> 19<dd><pre><CODE>#include <revolution/gx.h></CODE></pre> 20 </dd> 21<dd><pre><CODE>void GXLoadPosMtxIndx( 22u16 mtxIndx, 23u32 <a href="../Enumerated_Types/GXPosNrmMtx.html">id</a> );</CODE></pre> 24 </dd> 25</dl> 26 27<h2>Arguments</h2> 28<TABLE border="1" cellpadding="3" cellspacing="0.1"> 29 <tr> 30<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>mtxIndx</CODE></strong></em></TD> 31<TD width="520">Specifies the index to the matrix data in the main memory.</TD> 32 </tr> 33 <tr> 34<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>id</CODE></strong></em></TD> 35<TD width="520">Specifies the matrix name. Can specify a value enumerated by <CODE><A href="../Enumerated_Types/GXPosNrmMtx.html">GXPosNrmMtx</A></CODE>.</TD> 36 </tr> 37</TABLE> 38<h2>Return Values</h2> 39 40<p>None.</p> 41<H2>Description</H2> 42<P>This function loads the 3x4 matrix model view matrix indicated by the index <CODE><EM><STRONG>mtxIndx</STRONG></EM></CODE> from the array in main memory set by the function described next into the matrix memory location <CODE><EM><STRONG>id</STRONG></EM></CODE>.</P> 43<P><code><a href="../Geometry/GXSetArray.html">GXSetArray</a>(GX_POS_MTX_ARRAY, ...);</code></P> 44<P>The allowed <em><code><strong>id</strong></code></em> memory location is described by the <code><a href="../Enumerated_Types/GXPosNrmMtx.html">GXPosNrmMtx</a></code> enumeration. This modelview matrix is used to transform positions in model space to view space, either by making the matrix the current one (see <a href="GXSetCurrentMtx.html"><code>GXSetCurrentMtx</code></a>), or by setting a matrix <code><em><strong>id</strong></em></code> for each vertex (see <a href="../Geometry/GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>). The matrix will be loaded through the vertex cache.</P> 45<P>You can also load a normal matrix (<a href="GXLoadNrmMtxImm.html"><code>GXLoadNrmMtxImm</code></a> or <a href="GXLoadNrmMtxIndx3x3.html"><code>GXLoadNrmMtxIndx3x3</code></a>) to the same <code><em><strong>id</strong></em></code>. Usually the normal matrix will be the inverse transpose of the modelview matrix. The normal matrix is used for <a href="../toc.html#Lighting">vertex lighting</a>. In cases where the inverse transpose of the modelview and the modelview matrix are the same (excluding translation), you can load the <em>same</em> matrix for both the normal and the position matrix. Since indexed matrix loads are through the vertex cache, you will only incur the main memory bandwidth of one matrix load. </P> 46<P><B>Note:</B> The matrix is loaded directly from main memory into the matrix memory through the vertex cache, so it is incoherent with the CPU's cache. It's the application's responsibility to flush any matrix data from the CPU cache (see <a href="../../os/Cache/DCStoreRange.html"><code>DCStoreRange</code></a>) before calling this function.</P> 47 48<h2>See Also</h2> 49 50<p><a href="GXSetCurrentMtx.html">GXSetCurrentMtx</a><br> <a href="GXLoadNrmMtxImm.html">GXLoadNrmMtxImm</a><br> <a href="GXLoadNrmMtxIndx3x3.html">GXLoadNrmMtxIndx3x3</a><br> <a href="GXLoadPosMtxImm.html">GXLoadPosMtxImm</a></p> 51<H2>Revision History</H2> 52<P>03/01/2006 Initial version.</P> 53</BODY> 54</HTML>