Public Group

# triangle-triangle collision detection

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

## Recommended Posts

Hi. I've been reading up on collision detection, and pretty much everything that I've seen covers line-plane collisions and line-triangle collisions (by checking for a line-plane and then checking if the point of intersection lies on the triangle). But what about triangle to triangle collisions? My first guess would be to treat each vertex in one triangle as a line (using current position, and position from last frame possibly) and use those to check against the triangles of the other mesh for collisions. What I want to know, is whether this is the "proper" way of doing collision detection. Is there a better way?

##### Share on other sites
Is it possible that this question should have been posted in the Math and Physics section?

##### Share on other sites
I'm working on triangles at the moment for my latest attempt at a 3d editor, at the moment it's all based on triangles, the thing with collision as you asked though is usually you check for collision in a certain direction, such as forward or, and to the sides, thats why a line is suitable, using a plane is probably the most simple way to do it as well, you lay the plane flat with the triangle (what ever direction the triangle faces), then just see if the line goes through it.

Using lines from vertices means you'd have to do a lot more checking.

##### Share on other sites
What about if I have two meshes colliding with each other? What's the best way to check for that?

##### Share on other sites
Look in the Math & Physics Section, as I would bet that All the answers to your questions have already been answered plenty of times. Also try [google] groups, as these algorithms have been throughly explained, and you can even find free source code as coding tri-tri collision can be complex for a beginner.

GOD I

# HATE

##### Share on other sites
I wrote triangle-triangle collision. Go here for source and a demo.

• 13
• 18
• 29
• 11
• 20