DirectX SDK |
The D3DXMatrixOrthoOffCenter function builds a customized right-handed orthogonal projection matrix.
D3DXMATRIX* D3DXMatrixOrthoOffCenter( D3DXMATRIX* pOut, float l, float r, float t, float b, float zn, float zf );
A pointer to a D3DXMATRIX structure that is a right-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 D3DXMatrixOrtho function is a special case of the D3DXMatrixOrthoOffCenter function, in order to create the same projection using D3DXMatrixOrthoOffCenter, you should use the following values: l = -w/2, r = w/2, b = -h/2, and t = h/2.
All of the parameters of the D3DXMatrixOrthoOffCenter 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 D3DXMatrixOrthoOffCenter 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.
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.
D3DXMatrixOrtho, D3DXMatrixOrthoLH, D3DXMatrixOrthoOffCenterLH