# D3DXMatrixPerspectiveOffCenterLH function (D3dx9math.h)

Note

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

Builds a customized, left-handed perspective projection matrix.

## Syntax

``````D3DXMATRIX* D3DXMatrixPerspectiveOffCenterLH(
_Inout_ D3DXMATRIX *pOut,
_In_    FLOAT      l,
_In_    FLOAT      r,
_In_    FLOAT      b,
_In_    FLOAT      t,
_In_    FLOAT      zn,
_In_    FLOAT      zf
);
``````

## Parameters

pOut [in, out]

Type: D3DXMATRIX*

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

l [in]

Type: FLOAT

Minimum x-value of the view volume.

r [in]

Type: FLOAT

Maximum x-value of the view volume.

b [in]

Type: FLOAT

Minimum y-value of the view volume.

t [in]

Type: FLOAT

Maximum y-value 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 a D3DXMATRIX structure that is a customized, left-handed perspective projection matrix.

## Remarks

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

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

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

## Requirements

Requirement Value
D3dx9math.h
Library
D3dx9.lib

Math Functions

D3DXMatrixPerspectiveRH

D3DXMatrixPerspectiveLH

D3DXMatrixPerspectiveFovRH

D3DXMatrixPerspectiveFovLH

D3DXMatrixPerspectiveOffCenterRH