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>MTXPerspective</TITLE>
9</HEAD>
10<BODY>
11<H1>MTXPerspective</H1>
12
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/mtx.h&gt;
16
17void MTXPerspective (
18    Mtx44 m,
19    f32   fovy,
20    f32   aspect,
21    f32   n,
22    f32   f );
23</pre></dd></dl>
24
25<H2>Arguments</H2>
26<TABLE class="arguments" border="1" >
27  <TBODY>
28    <TR>
29<TH><em><strong><code>m</code></strong></em>&nbsp;&nbsp;</TH>
30<TD>New 4x4 projection matrix</TD>
31    </TR>
32    <TR>
33<TH>fovy</TH>
34<TD>Total field of view in the Y-Z plane measured in degrees</TD>
35    </TR>
36    <TR>
37<TH><STRONG><EM><CODE>aspect</CODE></EM></STRONG></TH>
38<TD>View window aspect ratio (width/height)</TD>
39    </TR>
40    <TR>
41<TH><STRONG><EM><CODE>n</CODE></EM></STRONG></TH>
42<TD>Positive distance to near clipping plane.</TD>
43    </TR>
44    <TR>
45<TH><STRONG><EM><CODE>f</CODE></EM></STRONG></TH>
46<TD>Positive distance to far clipping plane.</TD>
47    </TR>
48  </TBODY>
49</TABLE>
50
51<H2>Return Values</H2>
52<P>None.</P>
53
54<H2>Description</H2>
55<P>Sets the 4x4 perspective transform matrix based on two parameters for field-of-view and aspect ratio. This matrix is used by the GX API to transform points to screen space.</P>
56<P>The <CODE>MTXPerspective</CODE> function generates a projection matrix, equivalent to that created by the <A href="MTXFrustum.html"><CODE>MTXFrustum</CODE></A> function, with the axis of projection centered around the Z axis. This function is included to provide an alternative method of specifying the size of the view frustum.</P>
57<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. Both <SPAN class="argument">n</SPAN> and <SPAN class="argument">f</SPAN> must be positive values representing the distance to the near and far clipping planes, respectively.</P>
58<P><STRONG>Note:</STRONG> <SPAN class="argument">m</SPAN> must possess a negative Z value in order to make points that have been subjected to transform visible after projection to view space.</P>
59
60<H2>See Also</H2>
61<P class="reference">
62<A href="../structures/Mtx44_Mtx44Ptr.html">Mtx44, Mtx44Ptr</A>,
63<A href="MTXFrustum.html">MTXFrustum</A>,
64<A href="MTXOrtho.html">MTXOrtho</A>
65</P>
66
67<H2>Revision History</H2>
68<P>
692006/03/01 Initial version.<br>
70</p>
71
72<hr><p>CONFIDENTIAL</p></body>
73</HTML>