D3DXMatrixPerspectiveFovLH
Microsoft DirectX 9.0 SDK Update (October 2004)

D3DXMatrixPerspectiveFovLH Function


Builds a left-handed perspective projection matrix based on a field of view.

Syntax

D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovLH(      

    D3DXMATRIX *pOut,     FLOAT fovy,     FLOAT Aspect,     FLOAT zn,     FLOAT zf );

Parameters

pOut
[in, out] Pointer to the D3DXMATRIX structure that is the result of the operation.
fovy
[in] Field of view in the y direction, in radians.
Aspect
[in] Aspect ratio, defined as view space width divided by height.
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 left-handed perspective projection matrix.



Remarks

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

This function computes the returned matrix as shown:

xScale     0          0               0
0        yScale       0               0
0          0       zf/(zf-zn)         1
0          0       -zn*zf/(zf-zn)     0
where:
yScale = cot(fovY/2)

xScale = aspect ratio * yScale

Function Information

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

See Also

D3DXMatrixPerspectiveRH, D3DXMatrixPerspectiveLH, D3DXMatrixPerspectiveFovRH, D3DXMatrixPerspectiveOffCenterRH, D3DXMatrixPerspectiveOffCenterLH


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.