Jump to content
  • Advertisement

Archived

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

Crypthor

Bounding Boxes question.

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

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!