D3DXMatrixOrthoRH function

Builds a right-handed orthographic projection matrix.

Syntax

D3DXMATRIX* D3DXMatrixOrthoRH(
  _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.

zf [in]

Type: FLOAT

Maximum z-value of the view volume.

Return value

Type: D3DXMATRIX*

Pointer to the resulting D3DXMATRIX.

Remarks

All the parameters of the D3DXMatrixOrthoRH 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 D3DXMatrixOrthoRH 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/(zn-zf)   0
0    0    zn/(zn-zf)  1

Requirements

Header
D3dx9math.h
Library
D3dx9.lib

See also

Math Functions

D3DXMatrixOrthoLH

D3DXMatrixOrthoOffCenterRH

D3DXMatrixOrthoOffCenterLH