Microsoft DirectX 9.0

D3DXMatrixOrthoOffCenterLH Function

Builds a customized, left-handed orthogonal projection matrix.


D3DXMATRIX *D3DXMatrixOrthoOffCenterLH(      

    D3DXMATRIX *pOut,     FLOAT l,     FLOAT r,     FLOAT b,     FLOAT t,     FLOAT zn,     FLOAT zf );


[in, out] Pointer to the D3DXMATRIX structure that is the result of the operation.
[in] Minimum x-value of view volume.
[in] Maximum x-value of view volume.
[in] Minimum y-value of view volume.
[in] Maximum y-value of view volume.
[in] Minimum z-value of the view volume.
[in] Maximum z-value of the view volume.

Return Value

Pointer to a D3DXMATRIX structure that is a customized, left-handed orthogonal projection matrix.


An orthogonal matrix is an invertible matrix for which the inverse of the matrix is equal to the transpose of the matrix.

The D3DXMatrixOrthoLH function is a special case of the D3DXMatrixOrthoOffCenterLH function. To create the same projection using D3DXMatrixOrthoOffCenterLH, use the following values: l = -w/2, r = w/2, b = -h/2, and t = h/2.

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

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

2/(r-l)      0            0           0
0            2/(t-b)      0           0
0            0            1/(zf-zn)   0
(l+r)/(l-r)  (t+b)/(b-t)  zn/(zn-zf)  1

Function Information

Import libraryd3dx9.lib
Minimum operating systems Windows 98

See Also

D3DXMatrixOrthoRH, D3DXMatrixOrthoLH, D3DXMatrixOrthoOffCenterRH

© 2002 Microsoft Corporation. All rights reserved.