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><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/ulcd/Overview.html">ulcd</a>::<a href="../../../../nn/ulcd/CTR/Overview.html">CTR</a>::<a href="../../../../nn/ulcd/CTR/StereoCamera/Overview.html">StereoCamera</a>::CalculateMatrices</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/ulcd.h&gt;
14
15<a href="../../../../nn_types/f32.html">f32</a> CalculateMatrices(
16     <a href="../../../../nn/math/Matrix44.html">nn::math::Matrix44</a> * projL,
17     <a href="../../../../nn/math/Matrix34.html">nn::math::Matrix34</a> * viewL,
18     <a href="../../../../nn/math/Matrix44.html">nn::math::Matrix44</a> * projR,
19     <a href="../../../../nn/math/Matrix34.html">nn::math::Matrix34</a> * viewR,
20     const <a href="../../../../nn/math/Matrix44.html">nn::math::Matrix44</a> * projOriginal,
21     const <a href="../../../../nn/math/Matrix34.html">nn::math::Matrix34</a> * viewOriginal,
22     const <a href="../../../../nn_types/f32.html">f32</a> depthLevel,
23     const <a href="../../../../nn_types/f32.html">f32</a> factor,
24     const bool realSwitch
25);
26</pre>
27    </div>
28<h2>Parameters</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>
89This function has been retained in order to maintain compatibility with previous versions of the SDK. For reasons described below, the function is scheduled to be deleted in a future version upgrade.
90            </P><P>
91This function branches and calculates the specified projection matrix based on the specified calculation method, so it takes more processing time than the <CODE>CalculateMatrices</CODE> and <CODE>CalculateMatricesReal</CODE> functions prepared for each calculation method.
92</P><br /><br /><P>For the input projection matrix, use one that was created using either <CODE>nn::math::MTX44Frustum</CODE> or <CODE>nn::math::MTX44Perspective</CODE>.
93</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.
94</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.
95</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.
96</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.
97            </P></div>
98<h2>Revision History</h2>
99    <div class="section">
100      <dl class="history">
101        <dt>2011/06/22</dt>
102<dd>Added reason for why function will be deleted in future version upgrade.<br />
103        </dd>
104        <dt>2010/09/13</dt>
105<dd>Noted that execution stops at an assertion prior to initialization.
106        </dd>
107        <dt>2010/05/25</dt>
108<dd>Fixed omissions in <B>Description</B>.<br />
109        </dd>
110        <dt>2010/04/02</dt>
111<dd>Initial version.<br />
112        </dd>
113      </dl>
114    </div>
115  <hr><p>CONFIDENTIAL</p></body>
116</html>