Public Group

# Bounding boxes

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

## Recommended Posts

I was wondering... I am currently using a half assed system for an assignment, we have to, we have no choice... I was wondering How could I make abounding boxes which are on an angle, currently the bounding box system in this world can only handle having the bounding box on the X or the Y axis, pretty much you can only:
_
|_|

you can't
_
/ - _
/_ /
- _/

Which is a problem
Could anyone link me to a tutorial on bounding boxes which can handle angles, what I was thinking was somthing where I can make a bounding box which is rotatable
maybe ill when I check for collision I will pass in Xstart, Zstart, Xend, YEnd, camLocation, angle, then make Xend, Yend and CamLocation relitive to the Xstart and Ystart (as in, Xend-Xstart) then put them into a matrix and rotate the matrix by angle and check to see if the collision is above or below Zstart between Xstart to Xend?

##### Share on other sites
What you want is called an object orientated bounding box.

I think this link gives an example -
http://www.3dkingdoms.com/weekly/weekly.php?a=21

But the calculation is more expensive than an axis-aligned box (which is what you have at the mo) so normally it is best to check with a sphere or the box you have at the moment before doing the more complex checks.

x

##### Share on other sites
Like monkan says,

Can't you just check for triangle vs triangle or ray vs triangle after there is a normal (axis aligned) bounding box intersection. This is pretty much standard workflow.

##### Share on other sites
Instead of rotating the bounding boxes, you can inverse-rotate the coordinate you are about to test. This would allow you to test against axis-aligned bounding boxes.

Thanks

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 15
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
634150
• Total Posts
3015829
×

## 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!