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>tf-mirror</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">tf-mirror</H1>
12
13<H2>Description</H2>
14<P><CODE>tf-mirror</CODE> renders geometry about a reflected viewpoint. The Embedded Frame Buffer (EFB) is copied to a texture format. The texture is then applied to a quad to imitate a planar mirror.</P>
15<P>The reflection can be generated using a smaller viewport than the actual scene. This speeds rendering but results in blurrier reflections. The demo uses <a href="../../../gx/Transform/GXProject.html"><code>GXProject</code></a> to find the bounding box of the reflector in screen space, and only that part of the EFB is copied.</P>
16
17<H2>Coverage</H2>
18<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640">
19  <TBODY>
20    <TR>
21<TD width="30%" bgcolor="#C0C0C0"><EM><STRONG>Functions</STRONG></EM></TD>
22<TD width="25%" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD>
23<TD width="45%" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD>
24    </TR>
25    <TR>
26<TD width="30%" rowspan="3"><A href="../../../mtx/model/MTXReflect.html"><CODE>MTXReflect</CODE></A></TD>
27<TD width="25%"><SPAN class="argument"><em><strong><code>m</code></strong></em>&nbsp;&nbsp;</SPAN></TD>
28<TD width="45%">Generated matrix.</TD>
29    </TR>
30    <TR>
31<TD width="25%"><SPAN class="argument">p</SPAN></TD>
32<TD width="45%">Point on reflector.</TD>
33    </TR>
34    <TR>
35<TD width="25%"><SPAN class="argument"><STRONG><EM><CODE>n</CODE></EM></STRONG></SPAN></TD>
36<TD width="45%">Normal to reflector.</TD>
37    </TR>
38    <TR>
39<TD width="30%"><A href="../../../gx/Transform/GXProject.html"><CODE>GXProject</CODE></A></TD>
40<TD width="25%"><SPAN class="argument">All</SPAN></TD>
41<TD width="45%">Used with the reflected model-view matrix to project the mirror in screen space.</TD>
42    </TR>
43    <TR>
44<TD width="30%"><A href="../../../gx/Transform/GXGetProjectionv.html"><CODE>GXGetProjectionv</CODE></A></TD>
45<TD width="25%"><SPAN class="argument">p</SPAN></TD>
46<TD width="45%">Used to get the current projection (matrix) to pass to <code>GXProject</code>.</TD>
47    </TR>
48    <TR>
49<TD width="30%"><A href="../../../gx/Transform/GXGetViewportv.html"><CODE>GXGetViewportv</CODE></A></TD>
50<TD width="25%"><SPAN class="argument">vp</SPAN></TD>
51<TD width="45%">Used to get the current viewport to pass to <code>GXProject</code>.</TD>
52    </TR>
53    <TR>
54<TD width="30%"><A href="../../../gx/Transform/GXSetViewportv.html"><CODE>GXSetViewportv</CODE></A></TD>
55<TD width="25%"><SPAN class="argument">vp</SPAN></TD>
56<TD width="45%">Used to restore the viewport.</TD>
57    </TR>
58    <TR>
59<TD width="30%"><A href="../../../gx/Texture/GXGetTexBufferSize.html"><CODE>GXGetTexBufferSize</CODE></A></TD>
60<TD width="25%"><SPAN class="argument">All</SPAN></TD>
61<TD width="45%">Computes the size of the texture buffer needed for the copied reflection texture.</TD>
62    </TR>
63  </TBODY>
64</TABLE>
65
66<H2>Using the Demo</H2>
67<P>START exits the test. The Control Stick rotates the mirror. The C Stick moves the mirror. The A Button switches to orthogonal projection mode. The X Button controls the reflected viewport scale. The B Button enables rotation of the reflected image.</P>
68
69<H2>Snapshot</H2>
70<P><IMG src="./images/tf-mirror.jpg" alt="tf-mirror.jpg (11715 bytes)" width="640" height="448"></P>
71
72<H2>Required Data Files</H2>
73<P><CODE>$REVOLUTION_SDK_ROOT/dvddata/gxTests/tf-02.tpl</CODE></P>
74
75<H2>Revision History</H2>
76<P>
772006/03/01 Initial version.<br>
78</P>
79
80<hr><p>CONFIDENTIAL</p></body>
81</HTML>