티스토리 뷰

 

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

 

syntax

c++

D3DXMATRIX* D3DXMatrixPerspectiveFovLH(

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

 

Prarmeters

pOut - Pointer to the D3DXMATRIX structure that is the result of the operation.

fovy - Field of view in the y Direction, in radians.

Aspect - Aspect ratio, defined as view space width divided by height.

zn - Z-value of the near view-plane.

zf - Z-value of the far view-plane.

 

Return value

Pointer to a D3DMATRIX 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 = yScale / aspect ratio

 

Reauirements

Header

D3dx9math.h

Library

D3dx9.lib

 

cf)  D3DXMatrixPerspectiveRH

D3DXMatrixPerspectiveRH

D3DXMatrixPerspectiveFovRH

D3DXMatrixPerspectiveOffCenterRH

D3DXMatrixPerspectiveOffCenterLH

source is

댓글