Sweep and prune obstacle containing boxes

Started by
2 comments, last by Gnollrunner 5 years, 9 months ago

Hey!

I am using sweep and prune algorithm to check collision detection in a 3D environment, as broad-phase, and the boxes that contain the obstacles have to be built before checking for the collisions of their projections on all the three axes.

So, can someone help me with how to start for building the boxes around the obstacles whose coordinates and faces are known to me, but not the shape.

 

 

Advertisement

I am not sure I understand the question. Are you asking how to construct the proxy AABB (Axis Aligned Bounding Box) from a mesh?

There might be a few ways but the brute force method is to first set a box's X, Y and Z min to some high value and then set it's X, Y and Z max to some low value and the go through every vertex in your model and expand the high and low bounds of the box as needed to accommodate the object you are tying find bounds for . This assumes we are talking about a mesh and not shapes that are stored as a formula.  Of course you could handle those too but it might be more tricky in some cases.

This topic is closed to new replies.

Advertisement