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>Mtx44 Extension</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">Mtx44 Extension</H1> 12<H2 align="left">C Specification</H2> 13<BLOCKQUOTE> 14<PRE><CODE> 15#include <revolution/mtx/mtx44ext.h> 16 17void MTX44Identity ( Mtx44 <em>m</em> ); 18void MTX44Copy ( const Mtx44 <em>src</em>, Mtx44 <em>dst</em> ); 19 20void MTX44Concat ( const Mtx44 <em>a</em>, const Mtx44 <em>b</em>, Mtx44 <em>ab</em> ); 21void MTX44Transpose ( const Mtx44 <em>src</em>, Mtx44 <em>xPose</em> ); 22void MTX44Inverse ( const Mtx44 <em>src</em>, Mtx44 <em>inv</em> ); 23 24void MTX44Trans ( Mtx44 <em>m</em>, f32 <em>xT</em>, f32 <em>yT</em>, f32 <em>zT</em> ); 25void MTX44TransApply ( const Mtx44 <em>src</em>, Mtx44 <em>dst</em>, f32 <em>xT</em>, f32 <em>yT</em>, f32 <em>zT</em> ); 26 27void MTX44Scale ( Mtx44 <em>m</em>, f32 <em>xS</em>, f32 <em>yS</em>, f32 <em>zS</em> ); 28void MTX44ScaleApply ( const Mtx44 <em>src</em>, Mtx44 <em>dst</em>, f32 <em>xS</em>, f32 <em>yS</em>, f32 <em>zS</em> ); 29 30void MTX44RotRad ( Mtx44 <em>m</em>, char <em>axis</em>, f32 <em>rad</em> ); 31void MTX44RotTrig ( Mtx44 <em>m</em>, char <em>axis</em>, f32 <em>sinA</em>, f32 <em>cosA</em> ); 32 33void MTX44RotAxisRad ( Mtx44 <em>m</em>, const Vec* <em>axis</em>, f32 <em>rad</em> ); 34 35void MTX44MultVec ( const Mtx44 <em>m</em>, const Vec* <em>src</em>, Vec* <em>dst</em> ); 36 37void MTX44MultVecArray ( const Mtx44 <em>m</em>, const Vec* <em>srcBase</em>, Vec* <em>dstBase</em>, u32 <em>count</em> ); 38void MTX44MultVecSR ( const Mtx44 <em>m</em>, const Vec* <em>src</em>, Vec* <em>dst</em> ); 39 40void MTX44MultVecArraySR ( const Mtx44 <em>m</em>, const Vec* <em>srcBase</em>, Vec* <em>dstBase</em>, u32 <em>count</em> );</CODE></PRE> 41</BLOCKQUOTE> 42 43<H2 align="left">Description</H2><P>These are extended functions for true 4x4 matrix computations that you can access by placing the additional header file, <CODE>revolution/mtx/mtx44ext.h</CODE>, in an include statement. We've provided the 4x4 extension functions for special-purpose uses (such as real-time patch tessellation on the CPU). If you are simply making transform matrices for the Broadway graphics processor and you don't have a particular reason to use the 4x4 functions, we highly recommend that you stick with the standard 3x4 matrix functions. This recommendation is based on the fact that there is less processing overhead with the 3x4 than with 4x4 matrix functions. </P><P>As with standard MTX library functions, each of these extended functions has both C language and paired-single assembler versions. Non-prefixed functions (i.e., those beginning with neither <CODE>C_</CODE> nor <CODE>PS</CODE>) are actually defined as macros for either C language or paired-single assembler functions where the binding rule is also the same as that of regular functions.</P><P>Features and arguments of each extended function are almost the same as the standard 3x4 matrix version, except for the fact that these functions use <A href="structures/Mtx44_Mtx44Ptr.html"><CODE>Mtx44</A></CODE> as the input/output matrix type instead of <CODE><A href="structures/Mtx_MtxPtr.html">Mtx</CODE></A>. </P><P>Details are described below:</P><P align="left"><strong><code>MTX44Identity:<br></code></strong>Provides a 4x4 identity matrix.<br><strong><code><br> MTX44Copy:<br></code></strong>Copies all 4x4 components.<br><strong><code><br> MTX44Concat:<br></code></strong>Performs true 4x4 vs. 4x4 concatenation.<br><strong><code><BR>TX44Transpose:<br></code></strong>Performs true 4x4 transposition.<br><strong><code><br>MTX44Inverse:<BR></CODE></STRONG>Performs true 4x4 inversion.<BR><STRONG><CODE><BR>MTX44Trans: <BR>MTX44TransApply: <BR>MTX44Scale: <BR>MTX44ScaleApply: <BR>MTX44RotRad: <BR>MTX44RotTrig: <BR>MTX44RotAxisRad:<br></CODE></STRONG>These functions behave the same as the standard 3x4 functions, but set the fourth row as (0, 0, 0, 1).<br><strong><code><br>MTX44MultVec: <br> MTX44MultVecArray:<br></code></strong>These functions perform 4x4 matrix vs. 4D vector multiplication by assuming the implicit fourth component of the input vector as 1. After multiplication, the resulting 4D vector (<em>x</em>, <em>y</em>, <em>z</em>, <em>w</em>) is embedded into an output 3D vector by calculating (<em>x</em>/<em>w</em>, <em>y</em>/<em>w</em>, <em>z</em>/<em>w</em>).<br><BR><CODE><STRONG>MTX44MultVecSR:<br> MTX44MultVecArraySR:<br></strong></code>These functions use only 3x3 submatrix components for the computation so that it becomes a standard 3x3 matrix vs. 3D vector multiplication.</P><P></P><H2 align="left">See Also</H2><P align="left"><A href="structures/Mtx44_Mtx44Ptr.html"><CODE>Mtx44, Mtx44Ptr</CODE></A></P><H2>Revision History</H2><P>2006/03/01 Initial version.</P></BODY></HTML>