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 15void 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 f32 depthLevel, 21 const f32 factor, 22 const <a href="../../../../nn/math/PivotDirection.html">nn::math::PivotDirection</a> pivot = nn::math::PIVOT_UPSIDE_TO_TOP 23); 24 25f32 CalculateMatrices( 26 <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projL, 27 <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewL, 28 <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projR, 29 <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewR, 30 const <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projOriginal, 31 const <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewOriginal, 32 const f32 depthLevel, 33 const f32 factor, 34 const bool realSwitch 35); 36</pre> 37 </div> 38<h2>List of Overloaded Member Functions</h2> 39 <div class="section"> 40 <table class="members"> 41 <tr> 42 <td> 43<a href="./CalculateMatrices(0).html"><CODE>CalculateMatrices ( nn::math::Matrix44 *, nn::math::Matrix34 *, nn::math::Matrix44 *, nn::math::Matrix34 *, const f32, const f32, const nn::math::PivotDirection )</CODE> </a> 44 </td> 45<td>Calculates the view matrices and projection matrices for the left and right cameras, using the application priority method.</td> 46 </tr> 47 <tr> 48 <td> 49<a href="./CalculateMatrices(1).html"><CODE>CalculateMatrices ( nn::math::Matrix44 *, nn::math::Matrix34 *, nn::math::Matrix44 *, nn::math::Matrix34 *, const nn::math::Matrix44 *, const nn::math::Matrix34 *, const f32, const f32, const bool )</CODE> </a> 50 </td> 51<td>Calculates the left and right matrices for stereoscopic vision based on the projection and view matrices used for normal rendering.</td> 52 </tr> </table> 53 </div> 54<h2>Description of <CODE>CalculateMatrices(nn::math::Matrix44 *, nn::math::Matrix34 *, nn::math::Matrix44 *, nn::math::Matrix34 *, const f32, const f32, const nn::math::PivotDirection)</CODE></h2> 55<div class="section"><!-- write here --><P>It performs matrix calculation based on the base camera specified by the application. The calculations performed by this function preserve the original view angle, so use of this function is recommended if you want to preserve the effect given by cameras that you have adjusted a certain way. 56</P><P>Once the projection matrix has been calculated and output, the upward direction of the camera will be the direction specified for the <SPAN class="argument">pivot</SPAN> argument. If <SPAN class="argument">pivot</SPAN> is set to <CODE>nn::math::PIVOT_NONE</CODE>, no rotation is applied. If an invalid value is specified for the <SPAN class="argument">pivot</SPAN> argument, the function halts on an assertion. The value <CODE>nn::math::PIVOT_UPSIDE_TO_TOP</CODE> is specified by default. 57</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. 58 </P></div> 59<h2>Description of <CODE>CalculateMatrices(nn::math::Matrix44 *, nn::math::Matrix34 *, nn::math::Matrix44 *, nn::math::Matrix34 *, const nn::math::Matrix44 *, const nn::math::Matrix34 *, const f32, const f32, const bool)</CODE></h2> 60<div class="section"><!-- 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>. 61</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. 62</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. 63</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. 64</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. 65 </P></div> 66 <hr><p>CONFIDENTIAL</p></body> 67</html>