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>MTXLightPerspective</H1>
12
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/mtx.h&gt;
16
17void MTXLightPerspective(
18    Mtx m,
19    f32 fovy,
20    f32 aspect,
21    f32 scaleS,
22    f32 scaleT,
23    f32 transS,
24    f32 transT );
25</pre></dd></dl>
26
27<H2>Arguments</H2>
28<TABLE class="arguments" border="1" >
29  <TBODY>
30    <TR>
31<TH><em><strong><code>m</code></strong></em>&nbsp;&nbsp;</TH>
32<TD>New 3x4 projection matrix. The type of <SPAN class="argument">m</SPAN> may be either <A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></A> or <A href="../structures/Mtx_MtxPtr.html"><CODE>MtxPtr</CODE></A>.</TD>
33    </TR>
34    <TR>
35<TH>fovy</TH>
36<TD>Total field of view in the Y-Z plane measured in degrees</TD>
37    </TR>
38    <TR>
39<TH><STRONG><EM><CODE>aspect</CODE></EM></STRONG></TH>
40<TD>View window aspect ratio (width/height)</TD>
41    </TR>
42    <TR>
43<TH>scaleS</TH>
44<TD>Scale in the <EM>S</EM> direction for projected coordinates (usually 0.5)</TD>
45    </TR>
46    <TR>
47<TH>scaleT</TH>
48<TD>Scale in the <EM>T</EM> direction for projected coordinates (usually 0.5)</TD>
49    </TR>
50    <TR>
51<TH>transS</TH>
52<TD>Translation in the <EM>S</EM> direction for projected coordinates (usually 0.5)</TD>
53    </TR>
54    <TR>
55<TH>transT</TH>
56<TD>Translation in the <EM>T</EM> direction for projected coordinates (usually 0.5)</TD>
57    </TR>
58  </TBODY>
59</TABLE>
60
61<H2>Return Values</H2>
62<P>None.</P>
63
64<H2>Description</H2>
65<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>
66<P>The <CODE>MTXLightPerspective</CODE> function generates a projection matrix equivalent to the one created by the <A href="MTXLightFrustum.html"><CODE>MTXLightFrustum</CODE></A> function, with an axis of projection centered around the Z axis. This function is included to provide an alternative method of specifying texture projection volume dimensions.</P>
67<P>The field of view (<SPAN class="argument">fovy</SPAN>) is the total field of view in degrees in the YZ plane. <SPAN class="argument">aspect</SPAN> is the ratio (width/height) of the viewing window in view space.</P>
68<P>Standard projection yields values ranging from -1.0 to 1.0 in both dimensions of the front clipping plane.&nbsp;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 S and T.&nbsp;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.&nbsp;Then they are translated by 0.5 to be in the range of 0.0 to 1.0.&nbsp;Other values can be used for translation and scale to yield different effects.</P>
69
70<H2>See Also</H2>
71<P class="reference">
72<A href="../structures/Mtx_MtxPtr.html">Mtx, MtxPtr</A>,
73<A href="MTXLightFrustum.html">MTXLightFrustum</A>,
74<A href="MTXLightOrtho.html">MTXLightOrtho</A>
75</P>
76
77<H2>Revision History</H2>
78<P>
792006/03/01 Initial version.<br>
80</P>
81
82<hr><p>CONFIDENTIAL</p></body>
83</HTML>