• Create Account

### #ActualNokobon

Posted 08 May 2012 - 08:29 AM

You are right. The word "oriented" threw me off: I thought an arbitrary bounding box would just be called a "bounding box". After a quick web search I see that your name is perfectly common.

I am pretty sure you cannot deduce the distance between two boxes from the projections alone, but perhaps there is something else I don't understand, since you seem to be testing 15 axes, and I can only think of 6 that matter. Would you mind explaining where the 15 axes come from?

6 axes: face-normals of both boxes
9 axes: pairwise crossproducts of distinct edges of both boxes (3*3)

The projection of the boxes needs to be done on these 15 axes. If on at least one of them the projections don't overlap, there is a plane that separates both boxes.
If the projections overlap on all axes, the boxes intersect, too. The penetration depth is the smallest overlap on an axis. So the minimum translation vector to get out of the collision is parallel to the axis with the smallest overlap.

The problem is, that the smallest distance between two non-intersecting boxes is not necessarily parallel to one of the 15 axes (e.g. when the minimum distance is between two vertices).

So I don't know if there is a way to deduce the distance from the projections...

### #2Nokobon

Posted 08 May 2012 - 08:12 AM

You are right. The word "oriented" threw me off: I thought an arbitrary bounding box would just be called a "bounding box". After a quick web search I see that your name is perfectly common.

I am pretty sure you cannot deduce the distance between two boxes from the projections alone, but perhaps there is something else I don't understand, since you seem to be testing 15 axes, and I can only think of 6 that matter. Would you mind explaining where the 15 axes come from?

6 axes: face-normals of both boxes
9 axes: pairwise crossproducts of distinct edges of both boxes (3*3)

The projection of the boxes needs to be done on these 15 axes. If on at least one of them the projections don't overlap, there is a plane that separates both boxes.
If the projections overlap on all axes, the boxes intersect, too. The penetration depth is the smallest overlap on an axis. So the minimum translation vector to get out of the collision is parallel to the axis with the smallest overlap.

The problem is, that the smallest distance between two non-intersecting boxes is not necessarily parallel to one of the 15 axes (i.e. when the minimum distance is between two vertices).

So I don't know if there is a way to deduce the distance from the projections...

### #1Nokobon

Posted 08 May 2012 - 07:18 AM

You are right. The word "oriented" threw me off: I thought an arbitrary bounding box would just be called a "bounding box". After a quick web search I see that your name is perfectly common.

I am pretty sure you cannot deduce the distance between two boxes from the projections alone, but perhaps there is something else I don't understand, since you seem to be testing 15 axes, and I can only think of 6 that matter. Would you mind explaining where the 15 axes come from?

6 axes: face-normals of both boxes
9 axes: pairwise crossproducts of distinct edges of both boxes (3*3)

The projection of the boxes needs to be done on these 15 axes. If on at least one of them the projections don't overlap, there is a plane that separates both boxes.
If the projections overlap on all axes, the boxes intersect, too. The penetration depth is the smallest overlap on an axis. So the minimum translation vector to get out of the collision is parallel to the axis with the smallest overlap.

The problem is, that the smallest distance between two non-intersecting boxes is not necessarily parallel to one of the 15 axes (i.e. when the minimum distance is between two vertices).

So I don't know how to get the distance based on the projections...

PARTNERS