Archived

This topic is now archived and is closed to further replies.

RatLord

D3DXComputeBoundingSphere help please

Recommended Posts

Im getting my collision system off the ground - but im having some problems with computing the bounding spheres of microsoft .x format models. My function call look a little somthing like this.... LPDIRECT3DVERTEXBUFFER8 ppVB; instance->m_actor->m_pMesh->GetVertexBuffer(&ppVB); D3DXComputeBoundingSphere( ppVB, instance->m_actor->m_pMesh->GetNumVertices(), 0, ¢er, &this->m_coll_sphere_radius ) I think its that third param which is causing the problems im really not sure which flags to use. Got some lights in the scene - not much in the way of textures at the moment. The function does not return an error message but the value of this->m_coll_sphere_radius comes out as 1.#INFO Any idea what i need to do to get this blasted thing to work? Thanks in advance

Share this post


Link to post
Share on other sites
i use this code to calculate mine


  
void* pVB;
lpMesh->LockVertexBuffer(D3DLOCK_READONLY, &pVB);

D3DXComputeBoundingSphere((D3DXVECTOR3*)pVB,
lpMesh->GetNumVertices(),
D3DXGetFVFVertexSize(lpMesh->GetFVF()),
&boundCenter, &boundRadius);

lpMesh->UnlockVertexBuffer();





hope it helps



To be considered a genius you just have to say what everybody knows in a way very few understand

Share this post


Link to post
Share on other sites