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

Syntax

#include <nn/ulcd.h>

void CalculateMatrices(
     nn::math::Matrix44 * projL,
     nn::math::Matrix34 * viewL,
     nn::math::Matrix44 * projR,
     nn::math::Matrix34 * viewR,
     const f32 depthLevel,
     const f32 factor,
     const nn::math::PivotDirection pivot = nn::math::PIVOT_UPSIDE_TO_TOP
);

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
);

List of Overloaded Member Functions

CalculateMatrices ( nn::math::Matrix44 *, nn::math::Matrix34 *, nn::math::Matrix44 *, nn::math::Matrix34 *, const f32, const f32, const nn::math::PivotDirection ) Calculates the view matrices and projection matrices for the left and right cameras, using the application priority method.
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 ) Calculates the left and right matrices for stereoscopic vision based on the projection and view matrices used for normal rendering.

Description of CalculateMatrices(nn::math::Matrix44 *, nn::math::Matrix34 *, nn::math::Matrix44 *, nn::math::Matrix34 *, const f32, const f32, const nn::math::PivotDirection)

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.

Once the projection matrix has been calculated and output, the upward direction of the camera will be the direction specified for the pivot argument. If pivot is set to nn::math::PIVOT_NONE, no rotation is applied. If an invalid value is specified for the pivot argument, the function halts on an assertion. The value nn::math::PIVOT_UPSIDE_TO_TOP is specified by default.

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

Description of 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)

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.


CONFIDENTIAL