|
![](/i/fill.gif) |
Am 27.01.2013 21:00, schrieb Trevor G Quayle:
> Stop thinking of everything!
Sorry, but I just can't help it ;-)
> OK one more think at this:
>
> 1) check outer boundary sphere intersection (radius = center to vertex). If no
> intersection (distance > r1 + r2), cubes don't intersect,
>
> else
>
> 2) check inner boundary sphere intersection (radius = center to face). If
> intersection (distance < r1 + r2), cubes intersect or nest.
>
> else
>
> 3) determine closest vertex for each cube to the center of other (don't need to
> check each vertex). if either vertex is inside other cube, intersected or nested
>
> else
>
> 4) for one cube, check each edge from closest vertex for intersection with each
> face from each vertex of other cube, if intersect, cubes intersect. (don't need
> to check every single one, only 3 edges from 1 and 3 faces from other)
>
> else
>
> 5) cubes don't intersect!
>
> Does that cover it all? Or is there some other scenario that falls outside
> these rules?
You're forgetting that the vertex of cube A closest to the /center/ of
cube B isn't necessarily the one closest to the /surface/ of the other.
Post a reply to this message
|
![](/i/fill.gif) |