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 name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>MTXPushFwd</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">MTXPushFwd</H1> 12<H2 align="left">C Specification</H2> 13<BLOCKQUOTE><CODE><CODE>#include <revolution/mtx.h></CODE></CODE></BLOCKQUOTE> 14<BLOCKQUOTE><CODE><CODE>MtxPtr MTXPushFwd( MtxStack* <EM>sPtr</EM>, const Mtx <EM>m</EM> );</CODE></CODE></BLOCKQUOTE> 15<H2 align="left">Arguments</H2> 16<DIV align="left"> 17<TABLE border="1" cellpadding="3" cellspacing="0.1"> 18 <TBODY> 19 <TR> 20<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>sPtr</EM></STRONG></CODE></TD> 21<TD width="520" valign="top" align="left">Pointer to a <A href="../structures/MtxStack_MtxStackPtr.html"><CODE>MtxStack</CODE></A> structure containing the matrix stack.</TD> 22 </TR> 23 <TR> 24<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>m</EM></STRONG></CODE></TD> 25<TD width="520">Matrix to post-concatenate with the current top of stack. <code><em><strong>m</strong></em></code> may be either an <A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></A> or an <A href="../structures/Mtx_MtxPtr.html"><CODE>MtxPtr</CODE></A>.</TD> 26 </TR> 27 </TBODY> 28</TABLE> 29</DIV> 30<H2 align="left">Return Values</H2> 31<P>Returns the stack pointer after the push operation.</P> 32<H2 align="left">Description</H2> 33<P>Creates a forward composite transformation matrix on the stack.</P> 34<P>On an empty stack, the function copies <code><em><strong>m</strong></em></code> to <code><strong><em>sPtr</em>->stackBase</strong></code> and sets <code><strong><em>sPtr</em>->stackPtr</strong></code> equal to <code><strong><em>sPtr</em>->stackBase</strong></code>. On an active stack, the push multiplies <code><strong>sPtr->stackPtr</strong> x <em><strong>m</strong></em></code> and places the result to <code><strong><em>sPtr</em>->stackPtr</strong> + MTX_PTR_OFFSET</code>. Matrices below this location are unaffected. After the push, the stack pointer is incremented by <code>MTX_PTR_OFFSET</code> to point to the newly pushed copy of <code><em><strong>m</strong></em></code>.</P> 35<P>This operation is equivalent to the following:</P> 36<BLOCKQUOTE><CODE>MTXConcat( sPtr->stackPtr, m, ( sPtr->stackPtr + MTX_PTR_OFFSET) );</CODE></BLOCKQUOTE> 37<P>Concatenation is post-order to facilitate the creation of forward transformation matrices on the stack. This means that matrices should be pushed in the opposite order of the desired transformation.</P> 38<P>When the result of <code>MTXPushFwd</code> causes a stack overflow, <A href="../../os/Error/ASSERTMSG.html"><CODE>ASSERTMSG</CODE></A></a> is executed.</P> 39 40 41<H2 align="left">See Also</H2> 42<P align="left"><A href="../../os/Error/ASSERTMSG.html"><CODE>ASSERTMSG, </CODE></A><A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx, MtxPtr</CODE></A>, <A href="../structures/MtxStack_MtxStackPtr.html"><CODE>MtxStack, MtxStackPtr</CODE></A>, <A href="../general/MTXConcat.html"><CODE>MTXConcat</CODE></A>, <A href="MTXPop.html"><CODE>MTXPop</CODE></A>, <A href="MTXPush.html"><CODE>MTXPush</CODE></A>, <A href="MTXPushInv.html"><CODE>MTXPushInv</CODE></A>, <A href="MTXPushInvXpose.html"><CODE>MTXPushInvXpose</CODE></A></P> 43<H2 align="left">Revision History</H2> 44<P align="left">2006/03/01 Initial version.</P> 45<hr> 46<P>CONFIDENTIAL</p> 47</BODY> 48</HTML>