DirectX8 and 8. Bug

xiaoxiao2021-03-06  38

In directx8 and 8.1 sdk among mesh bounding box calculation algorithm is a function of the presence of a bug: D3DXComputeBoundingBox correct use is: LPD3DXMESH pxmesh = pMesh-> GetSysMemMesh (); BYTE * pPoints; if (D3D_OK = pxmesh-> LockVertexBuffer! (D3DLOCK_READONLY, & pPoints)) return false; DWORD dwNumVer = pxmesh-> GetNumVertices () 1; // note that this must be added 1 DWORD dwFVF = pxmesh-> GetFVF (); D3DXComputeBoundingBox (pPoints, dwNumVer, dwFVF, pMin, pMax ); Pxmesh-> unlockvertexbuffer (); this bug has been corrected in DX9.

转载请注明原文地址:https://www.9cbs.com/read-63586.html

New Post(0)