Platform SDK: DirectX

D3DXMatrixPerspectiveOffCenter

The D3DXMatrixPerspectiveOffCenter function builds a customized right-handed perspective projection matrix.

D3DXMATRIX* D3DXMatrixPerspectiveOffCenter(
  D3DXMATRIX* pOut,
  float l,
  float r,
  float t,
  float b,
  float zn,
  float zf
); 

Parameters

pOut
A pointer to the D3DXMATRIX structure that is the result of the operation.
l
The x-value of the near view-plane.
r
The x-value of the far view-plane.
t
The y-value of the near view-plane.
b
The y-value of the far view-plane.
zn
The z-value of the near view-plane.
zf
The z-value of the far view-plane.

Return Values

A pointer to a D3DXMATRIX structure that is a right-handed perspective projection matrix.

Remarks

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

The default projection matrix setup by the D3DXCreateContext and D3DXCreateContextEx functions is a left-handed perspective projection with a field-of-view (fov) of pi/2 radians.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxmath.h.
  Library: Use d3dx.lib.

See Also

D3DXMatrixPerspective, D3DXMatrixPerspectiveLH, D3DXMatrixPerspectiveFov, D3DXMatrixPerspectiveFovLH, D3DXMatrixPerspectiveOffCenterLH