• Advertisement
Sign in to follow this  

Inaccurate bounding box

This topic is 1525 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

1466313_795805073779182_1936955470_n.jpg


Don't know why it happens, is it because i scale the model?

void Direct3D::buildAABBFarm()
{
D3DXCreateBox(pDevice, Farm.box.GetWidth(), Farm.box.GetHeight(), Farm.box.GetDepth(), &AABBFarm, 0);
 
 
}
 
void Direct3D::buildFarm()
{
LoadXFile("Main\\Models\\Farm.x", &Farm.mesh, Farm.mtrls, Farm.textures);
 
VertexPNT* v = 0;
 
Farm.mesh->LockVertexBuffer(0, (void**)&v);
 
D3DXComputeBoundingBox(&v->pos, Farm.mesh->GetNumVertices(), Farm.mesh->GetNumBytesPerVertex(), &Farm.box.minPt, &Farm.box.maxPt);
 
Farm.mesh->UnlockVertexBuffer();
 
D3DXMATRIX World;
D3DXMATRIX Scale;
 
D3DXMatrixTranslation(&World, -82.85f + 29.0f, 40.50f + 50.0f, 39.44f);
D3DXMatrixScaling(&Scale, 0.01f, 0.01f, 0.01f);
 
FarmWorld = Scale * World;
 
 
}
Edited by newtechnology

Share this post


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

  • Advertisement