Skip to main content
gamedev.net
๐Ÿ”’ Locked

Computing Bounding box problems

Started by Milleniumas Jun 16, 2007 at 8:42 AM 0 replies 700+ views
Original Post
Milleniumas
Milleniumas
Have some strange problems. Some models computes BBox normal, but others are like half sliced. It seems that models are different in some files. So a few screens first: Good one: Free Image Hosting at www.ImageShack.us Bad one: Free Image Hosting at www.ImageShack.us Code from which I compute BBox:



BYTE* pVertices=NULL;
Model->LockVertexBuffer(D3DLOCK_READONLY, (LPVOID*)&pVertices);
D3DXComputeBoundingBox((D3DXVECTOR3*)pVertices, Model->GetNumVertices(), D3DXGetFVFVertexSize(Model->GetFVF()), &minBounds, &maxBounds);
Model->UnlockVertexBuffer();

D3DXCreateBox(D3D9, maxBounds.x-minBounds.x ,maxBounds.y-minBounds.y,maxBounds.z-minBounds.z, &BBox,NULL);


Any suggestions?
jbarcz1
jbarcz1

Are you sure that all of your models are FVF meshes?

Why don't you use ID3DXBaseMesh::GetNumBytesPerVertex() instead?
Joshua Barczak3D Application Research GroupAMD

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.