1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>GXSetProjection</title>
10</head>
11
12<body>
13
14<h1 align="left">GXSetProjection</h1>
15
16<h2>C Specification</h2>
17
18<dl>
19<dd><pre><CODE>#include &lt;revolution/gx.h&gt;</CODE></pre></dd>
20<dd><pre><CODE>void GXSetProjection( const f32 mtx[4][4], <a href="../Enumerated_Types/GXProjectionType.html">GXProjectionType</a> type );</CODE></pre></dd>
21</dl><h2>Arguments</h2>
22<TABLE border="1" cellpadding="3" cellspacing="0.1">
23  <tr>
24<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>mtx</font></strong></em></TD>
25<TD width="520">Specifies a pointer to the matrix data.</TD>
26    </tr>
27  <tr>
28<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>type</font></strong></em></TD>
29<TD width="520">Specifies the projection type. Accepted values are: <code>GX_PERSPECTIVE, GX_ORTHOGRAPHIC</code>.</TD>
30    </tr>
31</TABLE>
32<h2>Return Values</h2>
33
34<p>None.</p>
35<H2>Description</H2>
36<P>This function sets the projection matrix.&nbsp;Only two types of projection matrices are supported:</P>
37<P>Perspective Matrix Format:</P>
38<TABLE border="0" width="50%" style="border-left: 1px solid; border-right: 1px solid; border-top: medium none; border-bottom: medium none">
39  <TBODY>
40    <TR>
41<TD width="25%" align="center">p0</TD>
42      <TD width="25%" align="center">0</TD>
43<TD width="25%" align="center">p1</TD>
44      <TD width="25%" align="center">0</TD>
45    </TR>
46    <TR>
47      <TD width="25%" align="center">0</TD>
48<TD width="25%" align="center">p2</TD>
49<TD width="25%" align="center">p3</TD>
50      <TD width="25%" align="center">0</TD>
51    </TR>
52    <TR>
53      <TD width="25%" align="center">0</TD>
54      <TD width="25%" align="center">0</TD>
55<TD width="25%" align="center">p4</TD>
56<TD width="25%" align="center">p5</TD>
57    </TR>
58    <TR>
59      <TD width="25%" align="center">0</TD>
60      <TD width="25%" align="center">0</TD>
61      <TD width="25%" align="center">-1</TD>
62      <TD width="25%" align="center">0</TD>
63    </TR>
64  </TBODY>
65</TABLE>
66<P>Orthographic Matrix Format:</P>
67<TABLE border="0" width="50%" style="border-left: 1px solid; border-right: 1px solid; border-top: medium none; border-bottom: medium none">
68  <TBODY>
69    <TR>
70<TD width="25%" align="center">p0</TD>
71      <TD width="25%" align="center">0</TD>
72      <TD width="25%" align="center">0</TD>
73<TD width="25%" align="center">p1</TD>
74    </TR>
75    <TR>
76      <TD width="25%" align="center">0</TD>
77<TD width="25%" align="center">p2</TD>
78      <TD width="25%" align="center">0</TD>
79<TD width="25%" align="center">p3</TD>
80    </TR>
81    <TR>
82      <TD width="25%" align="center">0</TD>
83      <TD width="25%" align="center">0</TD>
84<TD width="25%" align="center">p4</TD>
85<TD width="25%" align="center">p5</TD>
86    </TR>
87    <TR>
88      <TD width="25%" align="center">0</TD>
89      <TD width="25%" align="center">0</TD>
90      <TD width="25%" align="center">0</TD>
91      <TD width="25%" align="center">1</TD>
92    </TR>
93  </TBODY>
94</TABLE>
95<P>Only the parameters p0-p5 are loaded into the hardware projection matrix. All the other numbers are implied by the projection <a href="../Enumerated_Types/GXProjectionType.html"><code><em>type</em></code></a>.</P>
96<P>The matrix data is copied from DRAM through the CPU cache into the graphics FIFO, so the matrix loaded that uses this function is always coherent with the CPU cache.</P>
97
98<h2>See Also</h2>
99
100<p><a href="../../mtx/Projection/MTXFrustum.html">MTXFrustum</a><br> <a href="../../mtx/Projection/MTXPerspective.html">MTXPerspective</a></p>
101<H2>Revision History</H2>
102<P>03/01/2006 Initial version.</P>
103</BODY>
104</HTML>