nn::ulcd::CTR::StereoCamera::GetParallax Member Function

Syntax

#include <nn/ulcd.h>

f32 GetParallax(
     const f32 distance
) const;

Arguments

Name Description
in distance Distance from the camera.

Return Values

Amount of offset, both to the left and right, of an object at the specified location (as a ratio with 1.0f = 100%).

Description

Gets the parallax of a point located a specified distance away from the camera. The parallax is expressed as a ratio of the screen width.

This function calculates and returns a value indicating the screen ratio by which to shift an object for both the left and right cameras at a distance specified by distance, where 1.0f indicates 100% (in other words, the return value is half of the offset between the images for the left and right eyes).

If a negative value is specified for distance, it returns 0.0f. It returns a positive value for objects located beyond the base plane. It returns a negative value for objects located in front of the base plane.

The results from this function are calculated based on the results obtained during the last call to the CalculateMatrices* functions.

Revision History

2010/09/13
Revised Description to make it easier to understand.
2010/04/02
Initial version.

CONFIDENTIAL