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;
14f32 CalculateMatrices(
15     <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projL,
16     <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewL,
17     <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projR,
18     <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewR,
19     const <a href="../../../../nn/math/MTX44/Overview.html">nn::math::Matrix44</a> * projOriginal,
20     const <a href="../../../../nn/math/MTX34/Overview.html">nn::math::Matrix34</a> * viewOriginal,
21     const f32 depthLevel,
22     const f32 factor,
23     const bool realSwitch
24);
25</pre>
26    </div>
27<h2>Arguments</h2>
28    <div class="section">
29      <table class="arguments">
30        <thead>
31          <tr>
32            <td width="15" />
33<th>Name</th>
34<td>Description</td>
35          </tr>
36        </thead>
37        <tr>
38<td>out</td>
39<th>projL</th>
40<td>Location where the calculated results for the left projection matrix are stored.</td>
41        </tr>
42        <tr>
43<td>out</td>
44<th>viewL</th>
45<td>Location where the calculated results for the left view matrix are stored.</td>
46        </tr>
47        <tr>
48<td>out</td>
49<th>projR</th>
50<td>Location where the calculated results for the right projection matrix are stored.</td>
51        </tr>
52        <tr>
53<td>out</td>
54<th>viewR</th>
55<td>Location where the calculated results for the right view matrix are stored.</td>
56        </tr>
57        <tr>
58<td>in</td>
59<th>projOriginal</th>
60<td>Original projection matrix.</td>
61        </tr>
62        <tr>
63<td>in</td>
64<th>viewOriginal</th>
65<td>Original view matrix.</td>
66        </tr>
67        <tr>
68<td>in</td>
69<th>depthLevel</th>
70<td>Distance (in virtual space) from the camera to the desired location on the LCD surface.</td>
71        </tr>
72        <tr>
73<td>in</td>
74<th>factor</th>
75<td>Depth adjustment factor. (A value of <CODE>0</CODE> indicates no parallax. A value of <CODE>1</CODE> indicates standard parallax.)</td>
76        </tr>
77        <tr>
78<td>in</td>
79<th>realSwitch</th>
80<td>Whether to allow changes to the view angle in order to elicit a more realistic effect.</td>
81        </tr> </table>
82    </div>
83<h2>Return Values</h2>
84    <div class="section"> </div>
85<h2>Description</h2>
86    <div class="section">
87<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>
88This 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.
89            </P><P>
90This 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.
91</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>.
92</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.
93</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.
94</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.
95</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.
96            </P></div>
97<h2>Revision History</h2>
98    <div class="section">
99      <dl class="history">
100        <dt>2011/06/22</dt>
101<dd>Added reason for why function will be deleted in future version upgrade.<br />
102        </dd>
103        <dt>2010/09/13</dt>
104<dd>Noted that execution stops at an assertion prior to initialization.
105        </dd>
106        <dt>2010/05/25</dt>
107<dd>Fixed omissions in <B>Description</B>.<br />
108        </dd>
109        <dt>2010/04/02</dt>
110<dd>Initial version.<br />
111        </dd>
112      </dl>
113    </div>
114  <hr><p>CONFIDENTIAL</p></body>
115</html>
116