D3DXMatrixPerspectiveFovRH function
Builds a righthanded perspective projection matrix based on a field of view.
Syntax
D3DXMATRIX* D3DXMatrixPerspectiveFovRH(
_Inout_ D3DXMATRIX *pOut,
_In_ FLOAT fovy,
_In_ FLOAT Aspect,
_In_ FLOAT zn,
_In_ FLOAT zf
);
Parameters

pOut [in, out]

Type: D3DXMATRIX*
Pointer to the D3DXMATRIX structure that is the result of the operation.

fovy [in]

Type: FLOAT
Field of view in the y direction, in radians.

Aspect [in]

Type: FLOAT
Aspect ratio, defined as view space width divided by height.

zn [in]

Type: FLOAT
Zvalue of the near viewplane.

zf [in]

Type: FLOAT
Zvalue of the far viewplane.
Return value
Type: D3DXMATRIX*
Pointer to a D3DXMATRIX structure that is a righthanded perspective projection matrix.
Remarks
The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXMatrixPerspectiveFovRH 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/(znzf) 1
0 0 zn*zf/(znzf) 0
where:
yScale = cot(fovY/2)
xScale = yScale / aspect ratio
Requirements
Header 

Library 

See also