nn::ulcd::CTR::StereoCamera::CalculateMatrices Member Function

Syntax

#include <nn/ulcd.h>

f32 CalculateMatrices(
     nn::math::Matrix44 * projL,
     nn::math::Matrix34 * viewL,
     nn::math::Matrix44 * projR,
     nn::math::Matrix34 * viewR,
     const nn::math::Matrix44 * projOriginal,
     const nn::math::Matrix34 * viewOriginal,
     const f32 depthLevel,
     const f32 factor,
     const bool realSwitch
);

Parameters

Name Description
out projL Location where the calculated results for the left projection matrix are stored.
out viewL Location where the calculated results for the left view matrix are stored.
out projR Location where the calculated results for the right projection matrix are stored.
out viewR Location where the calculated results for the right view matrix are stored.
in projOriginal Original projection matrix.
in viewOriginal Original view matrix.
in depthLevel Distance (in virtual space) from the camera to the desired location on the LCD surface.
in factor Depth adjustment factor. (A value of 0 indicates no parallax. A value of 1 indicates standard parallax.)
in realSwitch Whether to allow changes to the view angle in order to elicit a more realistic effect.

Return Values

Description

Calculates the left and right matrices for stereoscopic vision based on the projection and view matrices used for normal rendering.

This 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.

This function branches and calculates the specified projection matrix based on the specified calculation method, so it takes more processing time than the CalculateMatrices and CalculateMatricesReal functions prepared for each calculation method.



For the input projection matrix, use one that was created using either nn::math::MTX44Frustum or nn::math::MTX44Perspective.

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.

The realSwitch argument is used to select whether to use the application priority method or the realism priority method. Specifying true chooses the latter.

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 [return value] pixels to the left and right.

This function stops at an assertion if it is called before the Initialize function has been called on an instance of the StereoCamera class.

Revision History

2011/06/22
Added reason for why function will be deleted in future version upgrade.
2010/09/13
Noted that execution stops at an assertion prior to initialization.
2010/05/25
Fixed omissions in Description.
2010/04/02
Initial version.

CONFIDENTIAL