Sign in to follow this  
johnnyBravo

Why does D3DXComputeBoundingBox keep crashing?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this