Microsoft DirectX 9.0 SDK Update (October 2004)

Matrix.PerspectiveFovRH Method

Language:

Note: This documentation is preliminary and is subject to change.

Builds a right-handed perspective projection matrix based on a field of view (FOV).

Definition

Visual Basic .NET Public Shared Function PerspectiveFovRH( _
    ByVal fieldOfViewY As Single, _
    ByVal aspectRatio As Single, _
    ByVal znearPlane As Single, _
    ByVal zfarPlane As Single _
) As Matrix
C# public static Matrix PerspectiveFovRH(
    float fieldOfViewY,
    float aspectRatio,
    float znearPlane,
    float zfarPlane
);
Managed C++ public: static Matrix PerspectiveFovRH(
    float fieldOfViewY,
    float aspectRatio,
    float znearPlane,
    float zfarPlane
);
JScript .NET public static function PerspectiveFovRH(
    fieldOfViewY : float,
    aspectRatio : float,
    znearPlane : float,
    zfarPlane : float
) : Matrix;

Parameters

fieldOfViewY System.Single. Field of view in the y direction, in radians.
aspectRatio System.Single. Aspect ratio, defined as the view space width divided by height.
znearPlane System.Single. Z-value of the near view plane.
zfarPlane System.Single. Z-value of the far view plane.

Return Value

Microsoft.DirectX.Matrix . A Matrix structure that is a right-handed perspective projection matrix.

Remarks

This method uses the following formula to compute the returned matrix. The view space height is represented by h. It is calculated from h = cot(fieldOfViewY/2). The view space width is represented by w. It is calculated from h = w / aspectRatio.

w       0       0                                              0
0       h       0                                              0
0       0       zfarPlane/(znearPlane-zfarPlane)              -1
0       0       znearPlane*zfarPlane/(znearPlane-zfarPlane)    0

See Also


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center