MTXLightPerspective

Syntax

#include <revolution/mtx.h>

void MTXLightPerspective(
    Mtx m,
    f32 fovy,
    f32 aspect,
    f32 scaleS,
    f32 scaleT,
    f32 transS,
    f32 transT );

Arguments

m   New 3x4 projection matrix. The type of m may be either Mtx or MtxPtr.
fovy Total field of view in the Y-Z plane measured in degrees
aspect View window aspect ratio (width/height)
scaleS Scale in the S direction for projected coordinates (usually 0.5)
scaleT Scale in the T direction for projected coordinates (usually 0.5)
transS Translation in the S direction for projected coordinates (usually 0.5)
transT Translation in the T direction for projected coordinates (usually 0.5)

Return Values

None.

Description

Sets a 3x4 perspective projection matrix from field of view and aspect ratio parameters, two scale values, and two translation values. This matrix is used to project points into texture space and yield texture coordinates.

The MTXLightPerspective function generates a projection matrix equivalent to the one created by the MTXLightFrustum function, with an axis of projection centered around the Z axis. This function is included to provide an alternative method of specifying texture projection volume dimensions.

The field of view (fovy) is the total field of view in degrees in the YZ plane. aspect is the ratio (width/height) of the viewing window in view space.

Standard projection yields values ranging from -1.0 to 1.0 in both dimensions of the front clipping plane. Since texture coordinates should usually be within the range of 0.0 to 1.0, we have added a scale and translation value for both S and T. The most common way to use these values is to set all of them to 0.5 (so that points in the range of -1.0 to 1.0 are first scaled by 0.5) to be in the range of -0.5 to 0.5. Then they are translated by 0.5 to be in the range of 0.0 to 1.0. Other values can be used for translation and scale to yield different effects.

See Also

Mtx, MtxPtr, MTXLightFrustum, MTXLightOrtho

Revision History

2006/03/01 Initial version.


CONFIDENTIAL