DirectX SDK

D3DXMatrixOrthoLH

The D3DXMatrixOrthoLH function builds a left-handed orthogonal projection matrix.

D3DXMATRIX* D3DXMatrixOrthoLH(
  D3DXMATRIX* pOut,
  float w,
  float h,
  float zn,
  float zf
); 

Parameters

pOut
A pointer to the D3DXMATRIX structure that is the result of the operation.
w
The width of the view-volume.
h
The height of the view-volume.
zn
The minimum z-value of the view volume.
zf
The maximum z-value of the view volume.

Return Values

A pointer to a D3DXMATRIX structure that is a left-handed orthogonal projection matrix.

Remarks

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

All of the parameters of the D3DXMatrixOrthoLH 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 D3DXMatrixOrthoLH 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.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxmath.h.
  Library: Use d3dx.lib.

See Also

D3DXMatrixOrtho, D3DXMatrixOrthoOffCenter, D3DXMatrixOrthoOffCenterLH