?/TD>
Microsoft DirectX 9.0

D3DXMatrixPerspectiveRH Function


Builds a right-handed perspective projection matrix.

Syntax

D3DXMATRIX *D3DXMatrixPerspectiveRH(      

    D3DXMATRIX *pOut,     FLOAT w,     FLOAT h,     FLOAT zn,     FLOAT zf );

Parameters

pOut
[in, out] Pointer to the D3DXMATRIX structure that is the result of the operation.
w
[in] Width of the view volume at the near view-plane.
h
[in] Height of the view volume at the near view-plane.
zn
[in] Z-value of the near view-plane.
zf
[in] Z-value of the far view-plane.

Return Value

Pointer to a D3DXMATRIX structure that is a right-handed perspective projection matrix.

Remarks

All the parameters of the D3DXMatrixPerspectiveRH function are distances in camera space. The parameters describe the dimensions of the view volume.

The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXMatrixPerspectiveRH function can be used as a parameter for another function.

This function uses the following formula to compute the returned matrix.

2*zn/w  0       0              0
0       2*zn/h  0              0
0       0       zf/(zn-zf)    -1
0       0       zn*zf/(zn-zf)  0

Function Information

Headerd3dx9math.h
Import libraryd3dx9.lib
Minimum operating systems Windows 98

See Also

D3DXMatrixPerspectiveLH, D3DXMatrixPerspectiveFovRH, D3DXMatrixPerspectiveFovLH, D3DXMatrixPerspectiveOffCenterRH, D3DXMatrixPerspectiveOffCenterLH


© 2002 Microsoft Corporation. All rights reserved.