Microsoft KB Archive/305353

= DOC: DirectX Documentation Wrong on D3DXMatrixPerspectiveOffCenter Functions =

PSS ID Number: 305353

Article Last Modified on 2/11/2004

-

The information in this article applies to:

 Microsoft DirectX Software Development Kit 8.0a, when used with:  the operating system: Microsoft Windows 98

 the operating system: Microsoft Windows 98 Second Edition

 the operating system: Microsoft Windows XP 

-

<div class="notice_section">

This article was previously published under Q305353

<div class="summary_section">

SUMMARY
The &quot;Visual Basic&quot; and the &quot;Visual C++&quot; documentation for the D3DXMatrixPerspectiveOffCenterLH and D3DXMatrixPerspectiveOffCenterRH D3DX functions are not consistent with each other and the parameter descriptions are incorrect.

If you use D3DXMatrixPerspectiveOffCenterLH and D3DXMatrixPerspectiveOffCenterRH as described in the DirectX documentation to build a perspective projection matrix, you may get unexpected results.

<div class="moreinformation_section">

MORE INFORMATION
These two calls will build a perspective projection matrix if you provide the coordinates of the near and far clipping planes and the coordinates of the viewing window. If the coordinates of the viewing window are not specified in the correct order, the resulting projection matrix will be incorrect, as will images that are rendered through the use of this matrix.

The DirectX Visual Basic documentation defines D3DXMatrixPerspectiveOffCenterLH as follows: D3DXMatrixPerspectiveOffCenterLH( _    MOut As D3DMATRIX, _     l As Single, _     r As Single, _     b As Single, _     t As Single, _     zn As Single, _     zf As Single)

The DirectX Visual C++ documentation defines D3DXMatrixPerspectiveOffCenterLH as follows:

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

The parameter list shown in the Visual Basic documentation is correct while the parameter list in the Visual C++ documentation is incorrect. However, both the Visual Basic and Visual C++ documentation provide incorrect definitions for the parameters in the &quot;Parameters&quot; section of the documentation.

NOTE: The same error occurs in the documentation for D3DXMatrixPerspectiveOffCenterRH.

The parameters should be set as follows: The first four parameters, which are l, r, b, and t, define the (l)eft, (r)ight, (b)ottom, and (t)op coordinates for the rectangle describing the near clipping plane. The last two parameters are the distances of the near and far clipping planes from the camera/eye.

Keywords: kbDSWGDI2003Swept kbbug kbDirect3dIM kbdocerr kbGDI KB305353

Technology: kbAudDeveloper kbOSWin98 kbOSWin98SE kbOSWinSearch kbOSWinXP kbOSWinXPSearch kbSDKDirectX800A kbSDKDirectXsearch kbSDKSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.