views:

236

answers:

1

I'm looking for a pretty easy algorithm for a collision detection with two three-dimensional triangles, which can move constantly (rather better if the could accelerate, too). I've found a method to solve this problem but that's a difficult one with movement of the two three-dimensional triangles.

+3  A: 

First to clear some terminology:

Intersection detection will tell you if two things are intersecting.

Collision detection will tell if two things will collide.

There is a difference here. If one object [Polygon A] is moving quickly, and you are using intersection tests, it's possible for it to be non-intersecting, move past Polygon B, and then be on the other side, also non-intersecting.

Collision detection, on the other hand, will say, "Polygon A will collide with Polygon B". There is a subtle difference, so saying "Collision ... with some movement" is somewhat redundant.

The most intuitive way to do collision detection is to sweep the polygon's out over the course of the time step, and do intersection tests with the resulting polygons.

Anyway:

This page contains lots of information about determining if two shapes are intersecting.

This page is specifically about rays, planes, and triangles, and includes source code.

GMan