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>tf-mirror 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="../../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<H2>Coverage</H2> 17<TABLE border="1" cellpadding="3" cellspacing="0.1" width="640"> 18 <TBODY> 19 <TR> 20<TD width="30%" bgcolor="#C0C0C0"><EM><STRONG>Functions</STRONG></EM></TD> 21<TD width="25%" bgcolor="#C0C0C0"><EM><STRONG>Parameters</STRONG></EM></TD> 22<TD width="45%" bgcolor="#C0C0C0"><EM><STRONG>Description</STRONG></EM></TD> 23 </TR> 24 <TR> 25<TD width="30%" rowspan="3"><A href="../../../mtx/model/MTXReflect.html"><FONT face="Courier New">MTXReflect</FONT></A></TD> 26<TD width="25%"><em><strong><code>m</code></strong></em> </TD> 27<TD width="45%">Generated matrix.</TD> 28 </TR> 29 <TR> 30<TD width="25%"><STRONG><EM><CODE>p</CODE></EM></STRONG></TD> 31<TD width="45%">Point on reflector.</TD> 32 </TR> 33 <TR> 34<TD width="25%"><STRONG><EM><CODE>n</CODE></EM></STRONG></TD> 35<TD width="45%">Normal to reflector.</TD> 36 </TR> 37 <TR> 38<TD width="30%"><A href="../../../gx/Transform/GXProject.html"><FONT face="Courier New">GXProject</FONT></A></TD> 39<TD width="25%">all</TD> 40<TD width="45%">Used with the reflected model-view matrix to project the mirror in screen space.</TD> 41 </TR> 42 <TR> 43<TD width="30%"><A href="../../../gx/Transform/GXGetProjectionv.html"><FONT face="Courier New">GXGetProjectionv</FONT></A></TD> 44<TD width="25%"><STRONG><EM><CODE>p</CODE></EM></STRONG></TD> 45<TD width="45%">Used to get the current projection (matrix) to pass to <code>GXProject</code>.</TD> 46 </TR> 47 <TR> 48<TD width="30%"><A href="../../../gx/Transform/GXGetViewportv.html"><FONT face="Courier New">GXGetViewportv</FONT></A></TD> 49<TD width="25%"><STRONG><EM><CODE>vp</CODE></EM></STRONG></TD> 50<TD width="45%">used to get the current viewport to pass to <code>GXProject</code>.</TD> 51 </TR> 52 <TR> 53<TD width="30%"><A href="../../../gx/Transform/GXSetViewportv.html"><FONT face="Courier New">GXSetViewportv</FONT></A></TD> 54<TD width="25%"><STRONG><EM><CODE>vp</CODE></EM></STRONG></TD> 55<TD width="45%">Used to restore the viewport.</TD> 56 </TR> 57 <TR> 58<TD width="30%"><A href="../../../gx/Texture/GXGetTexBufferSize.html"><FONT face="Courier New">GXGetTexBufferSize</FONT></A></TD> 59<TD width="25%">All</TD> 60<TD width="45%">Computes the size of the texture buffer needed for the copied reflection texture.</TD> 61 </TR> 62 </TBODY> 63</TABLE> 64<H2>Operation Method</H2> 65<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 reflector.</P> 66<H2>Snapshot</H2> 67<P><IMG src="./images/tf-mirror.jpg" alt="tf-mirror.jpg (11715 bytes)" width="640" height="448"></P> 68<H2>Required Data Files</H2> 69<P><CODE>$REVOLUTION_SDK_ROOT/dvddata/gxTests/tf-02.tpl</CODE></P> 70<H2>Revision History</H2> 71<P>03/01/2006 Initial version.</P> 72</BODY> 73</HTML>