1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" /> 7<title>CalculateMatrices</title> 8 </head> 9 <body> 10<h1><CODE>nn::ulcd::CTR::StereoCamera::CalculateMatrices</CODE> Member Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition">#include <nn/ulcd.h> 14 15f32 CalculateMatrices( 16 <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projL, 17 <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewL, 18 <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projR, 19 <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewR, 20 const <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projOriginal, 21 const <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewOriginal, 22 const f32 depthLevel, 23 const f32 factor, 24 const bool realSwitch 25); 26</pre> 27 </div> 28<h2>Arguments</h2> 29 <div class="section"> 30 <table class="arguments"> 31 <thead> 32 <tr> 33 <td width="15" /> 34<th>Name</th> 35<td>Description</td> 36 </tr> 37 </thead> 38 <tr> 39<td>out</td> 40<th>projL</th> 41<td>Location where the calculated results for the left projection matrix are stored.</td> 42 </tr> 43 <tr> 44<td>out</td> 45<th>viewL</th> 46<td>Location where the calculated results for the left view matrix are stored.</td> 47 </tr> 48 <tr> 49<td>out</td> 50<th>projR</th> 51<td>Location where the calculated results for the right projection matrix are stored.</td> 52 </tr> 53 <tr> 54<td>out</td> 55<th>viewR</th> 56<td>Location where the calculated results for the right view matrix are stored.</td> 57 </tr> 58 <tr> 59<td>in</td> 60<th>projOriginal</th> 61<td>Original projection matrix.</td> 62 </tr> 63 <tr> 64<td>in</td> 65<th>viewOriginal</th> 66<td>Original view matrix.</td> 67 </tr> 68 <tr> 69<td>in</td> 70<th>depthLevel</th> 71<td>Distance (in virtual space) from the camera to the desired location on the LCD surface.</td> 72 </tr> 73 <tr> 74<td>in</td> 75<th>factor</th> 76<td>Depth adjustment factor. (A value of <CODE>0</CODE> indicates no parallax. A value of <CODE>1</CODE> indicates standard parallax.)</td> 77 </tr> 78 <tr> 79<td>in</td> 80<th>realSwitch</th> 81<td>Whether to allow changes to the view angle in order to elicit a more realistic effect.</td> 82 </tr> </table> 83 </div> 84<h2>Return Values</h2> 85 <div class="section"> </div> 86<h2>Description</h2> 87 <div class="section"> 88<p>Calculates the left and right matrices for stereoscopic vision based on the projection and view matrices used for normal rendering.</p><!-- write here --><P>For the input projection matrix, use one that was created using either <CODE>nn::math::MTX44Frustum</CODE> or <CODE>nn::math::MTX44Perspective</CODE>. 89</P><P>Once the projection matrix has been calculated and output, it is multiplied by a rotation matrix so that the upward direction of the camera meets the long edge of the upper LCD (the side opposite the lower LCD). As a result, there is no need to prepare an input matrix that takes into account the orientation of the LCD. 90</P><P>The <SPAN class="argument">realSwitch</SPAN> argument is used to select whether to use the application priority method or the realism priority method. Specifying <CODE>true</CODE> chooses the latter. 91</P><P> The return value indicates how far the screen images are offset to the left and right by the cameras that result from this calculation. The offsets are expressed as a percentage (1.0f = 100%), where 0% indicates no offset, and 100% indicates left/right offsets as wide as the screen. In other words, this indicates the distance that objects at infinity are offset along the screen. For example, let's assume you are rendering a distant landscape as a single image, and the screen width is 400 pixels. You can make the landscape appear to be at the farthest possible depth by offsetting this image by 400 x [<I>return value</I>] pixels to the left and right. 92</P><P>This function stops at an assertion if it is called before the <CODE>Initialize</CODE> function has been called on an instance of the <CODE>StereoCamera</CODE> class. 93 </P></div> 94<h2>Revision History</h2> 95 <div class="section"> 96 <dl class="history"> 97 <dt>2010/09/13</dt> 98<dd>Noted that execution stops at an assertion prior to initialization. 99 </dd> 100 <dt>2010/05/25</dt> 101<dd>Fixed omissions in <B>Description</B>.<br /> 102 </dd> 103 <dt>2010/04/02</dt> 104<dd>Initial version.<br /> 105 </dd> 106 </dl> 107 </div> 108 <hr><p>CONFIDENTIAL</p></body> 109</html>