# oriented boundingbox to triangle intersection?

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

## Recommended Posts

So let me start with the basics. I want to determine if a character hits a wall. My thinking was that a bounding box represents the player, and the wall ( a rectangle ) is represented by 2 triangles. Hence, I need to test for an intersection between a bounding box and a triangle. Does anyone have any code that would produce a result for this intersection? Yes, I've seen the 3D intersection table that everyone links. The only example for oriented bounding-box to triangle on that page is to GeometricTools.com. GeometricTools, to my knowledge, does not have an intersection class for oriented bounding-box to triangle. They have box to box, triangle to triangle, even box to plane, but no box to triangle. Or have I missed it somehow? Now, I suppose I COULD split up the box into 12 triangles, and do triangle to triangle tests. But that doesn't seem efficient; my impression is that bounding boxes use the center, axis, and extent of an OBB to determine a radius to the opposing polyhedra. Splitting the OBB into lots of triangles seems wasteful. Does anyone have any good suggestions for how to go about this, the most simple of collisions? Thanks much! Mike

##### Share on other sites
Are your walls allways verticals ?
If yes, just taking into account the intersection between a line (the wall seen from top) and the top and bottom of your bounding box should be enough ?

= Calculate the intersection between the 2 triangles of the top (and 2 triangles of the bottom) of your OBB (in 2D = only x,y coordinate, assume z is up) and the line (segment if you need to be limited) is easy no ? If your OBB has no rotation on X/Y axis, you just have to calculate with 2 triangles (top or bottom) ?

##### Share on other sites
Ironically, of the two forums you posted this in, you didn't hit the right one.

Please don't crosspost topics. I'll close this one and move the other one to M&P.

##### Share on other sites

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

This topic is now closed to further replies.

1. 1
Rutin
48
2. 2
3. 3
4. 4
5. 5

• 10
• 28
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633409
• Total Posts
3011717
• ### Who's Online (See full list)

There are no registered users currently online

×