D3DXMatrixOrthoLH function (D3dx9math.h)

Note

The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.

Builds a left-handed orthographic projection matrix.

Syntax

D3DXMATRIX* D3DXMatrixOrthoLH(
  _Inout_ D3DXMATRIX *pOut,
  _In_    FLOAT      w,
  _In_    FLOAT      h,
  _In_    FLOAT      zn,
  _In_    FLOAT      zf
);

Parameters

pOut [in, out]

Type: D3DXMATRIX*

Pointer to the resulting D3DXMATRIX.

w [in]

Type: FLOAT

Width of the view volume.

h [in]

Type: FLOAT

Height of the view volume.

zn [in]

Type: FLOAT

Minimum z-value of the view volume which is referred to as z-near.

zf [in]

Type: FLOAT

Maximum z-value of the view volume which is referred to as z-far.

Return value

Type: D3DXMATRIX*

Pointer to the resulting D3DXMATRIX.

Remarks

All the parameters of the D3DXMatrixOrthoLH 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 D3DXMatrixOrthoLH function can be used as a parameter for another function.

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

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

Requirements

Requirement Value
Header
D3dx9math.h
Library
D3dx9.lib

See also

Math Functions

D3DXMatrixOrthoRH

D3DXMatrixOrthoOffCenterRH

D3DXMatrixOrthoOffCenterLH