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>MTXLightPerspective</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">MTXLightPerspective</H1> 12<H2 align="left">C Specification</H2> 13<BLOCKQUOTE><CODE><CODE>#include <revolution/mtx.h><BR> <BR> void MTXLightPerspective(<BR> Mtx <EM>m</EM>,<BR> f32 <EM>fovy</EM>,<BR> f32 <EM>aspect</EM>,<BR> f32 <EM>scaleS</EM>,<BR> f32 <EM>scaleT</EM>,<BR> f32 <EM>transS</EM>,<BR> f32 <EM>transT</EM> );</CODE></CODE></BLOCKQUOTE> 14<H2 align="left">Arguments</H2> 15<DIV align="left"> 16<TABLE border="1" cellpadding="3" cellspacing="0.1"> 17 <TBODY> 18 <TR> 19<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>m</EM></STRONG></CODE></TD> 20<TD width="520">New 3x4 projection matrix. <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> 21 </TR> 22 <TR> 23<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>fovy</EM></STRONG></CODE></TD> 24<TD width="520">Total field of view in the Y-Z plane measured in degrees.</TD> 25 </TR> 26 <TR> 27<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>aspect</EM></STRONG></CODE></TD> 28<TD width="520">View window aspect ratio (width/height)</TD> 29 </TR> 30 <TR> 31<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>scaleS</EM></STRONG></CODE></TD> 32<TD width="520">Scale in the <EM>S</EM> direction for projected coordinates (usually 0.5).</TD> 33 </TR> 34 <TR> 35<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>scaleT</EM></STRONG></CODE></TD> 36<TD width="520">Scale in the <EM>T</EM> direction for projected coordinates (usually 0.5).</TD> 37 </TR> 38 <TR> 39<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>transS</EM></STRONG></CODE></TD> 40<TD width="520">Translate in the <EM>S</EM> direction for projected coordinates (usually 0.5).</TD> 41 </TR> 42 <TR> 43<TD width="120" valign="top" align="left" bgcolor="#ffffe8"><CODE><STRONG><EM>transT</EM></STRONG></CODE></TD> 44<TD width="520">Translate in the <EM>T</EM> direction for projected coordinates (usually 0.5).</TD> 45 </TR> 46 </TBODY> 47</TABLE> 48</DIV> 49<H2 align="left">Return Values</H2> 50<P align="left">None.</P> 51<H2 align="left">Description</H2> 52<P>Sets a 3x4 perspective projection matrix from field of view and aspect ratio parameters, two scale values, and two translation values. This matrix is used to project points into texture space and yield texture coordinates.</P> 53<P><code>MTXLightPerspective</code> generates a projection matrix, equivalent to that created by <a href="MTXLightFrustum.html"><code>MTXLightFrustum</code></a>, with the axis of projection centered around Z. This function is included to provide an alternative method of specifying texture projection volume dimensions.</P> 54<P>The field of view (<em><strong><code>fovy</code></strong></em>) is the total field of view in degrees in the YZ plane. <code><em><strong>aspect</strong></em></code> is the ratio (width / height) of the view window in screen space.</P> 55<P>Standard projection yields values ranging from -1.0 to 1.0 in both dimensions of the front clipping plane. Since texture coordinates should usually be within the range of 0.0 to 1.0, we have added a scale and translation value for both <EM>S</EM> and <EM>T</EM>. The most common way to use these values is to set all of them to 0.5 (so that points in the range of -1.0 to 1.0 are first scaled by 0.5) to be in the range of -0.5 to 0.5. Then they are translated by 0.5 to be in the range of 0.0 to 1.0. Other values can be used for translation and scale to yield different effects.</P> 56 57 58<H2 align="left">See Also</H2> 59<P align="left"><A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx, MtxPtr</CODE></A>, <A href="MTXLightFrustum.html"><CODE>MTXLightFrustum</CODE></A>, <A href="MTXLightOrtho.html"><CODE>MTXLightOrtho</CODE></A></P> 60<H2>Revision History</H2> 61<P>2006/03/01 Initial version.</P> 62<hr> 63<P>CONFIDENTIAL</p> 64</BODY> 65</HTML>