• Advertisement
Sign in to follow this  

Why does D3DXComputeBoundingBox keep crashing?

This topic is 4289 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi im using D3DXComputeBoundingBox, but it keeps crashing, and i can't work out what im doing wrong.
struct VERTEX{
   D3DXVECTOR3 pos;
   D3DXVECTOR3 norm;
   float tu;
   float tv;
};

VERTEX *pVerts;

if(SUCCEEDED(sphere->LockVertexBuffer(0, (void**)&pVerts))) {
	int numVerts=sphere->GetNumVertices();
		
	D3DXVECTOR3 vMin,vMax;
      //crashes here
	D3DXComputeBoundingBox((const D3DXVECTOR3*)pVerts,numVerts,D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1,&vMin,&vMax));
}

I've looked at multiple sources of code and they all are doing the same thing as me, but mine crashes.. What could I be possibly be doing wrong here? Thx!

Share this post


Link to post
Share on other sites
Advertisement
The third parameter is supposed to be the size of your structure, not the FVF.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement