#### Archived

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

# Bounding Boxes question.

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

## Recommended Posts

Hi. Well, if i''m using bounding boxes for collision testing: I can calculate distance between two points ( bounding box center and player position for example ). In case of Bounding Sphere: there just a radius, so this distance must be greater than radius. In case of BBox: i don''t know how to calculate bbox collision so please help, i''m sunking in math ! And BBox - is a cube or any dimensional box ? There is some formulas, can you tell me ? Thank You !

##### Share on other sites
Just do a loop and find the lowest X value and thats the left side, highest X value and thats the right side. Greatest Y Value, thats the top. Lowest Y Value thats the bottom. Lowest Z is the front. Greatest Z is the back. Sorry Im leaving for vacation right now so I dont have time to give you source, but Im sure you could easily right a loop through the vertices and do a simple if(). later,

##### Share on other sites
maybe too late but if u r using DirectX try D3DXComputeBoundingBox

##### Share on other sites
D3DXComputeBoundingBox will only compute an axis oriented bounding box, but will not check for bounding box to bounding box collision.

There are a couple of different kinds of bounding boxes and the boxes are boxes (not necessarily cubes). The two main kinds of bounding boxes are AABB (axis aligned bounding box) or OBB (oriented bounding box). The first one, AABB, has all six planes of the box aligned with the basis of the coordinate system. This is the simplest box and is that D3DXComputerBoundingBOx will create. OBB is much harder and will oriented the box to best fit the object. I am working on a tutorial for this for gamedev.

If you are using the AABB, you might as well stick to bounding spheres and just have a simple radius test (since you are "sunking in math").

Good luck,
/jk

Are you "down with OBB?"

[edited by - kershatwork on September 19, 2003 12:20:42 PM]

• 10
• 13
• 52
• 11
• 15
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!