# D3DXMatrixOrthoOffCenterRH function

Builds a customized, right-handed orthographic projection matrix.

## Syntax

```
D3DXMATRIX* D3DXMatrixOrthoOffCenterRH(
_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 resulting D3DXMATRIX.

l [in]

Type: FLOAT

Minimum x-value of view volume.

r [in]

Type: FLOAT

Maximum x-value of view volume.

b [in]

Type: FLOAT

Minimum y-value of view volume.

t [in]

Type: FLOAT

Maximum y-value of 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

The D3DXMatrixOrthoRH function is a special case of the D3DXMatrixOrthoOffCenterRH function. To create the same projection using D3DXMatrixOrthoOffCenterRH, use the following values:

l = -w/2,

r = w/2,

b = -h/2, and

t = h/2.

All the parameters of the D3DXMatrixOrthoOffCenterRH 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 D3DXMatrixOrthoOffCenterRH 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/(zn-zf)   0
(l+r)/(l-r)  (t+b)/(b-t)  zn/(zn-zf)  1

```