triangle-triangle collision detection

Started by
5 comments, last by CGameProgrammer 19 years, 7 months ago
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?
Advertisement
Is it possible that this question should have been posted in the Math and Physics section?
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.
What about if I have two meshes colliding with each other? What's the best way to check for that?
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

THAT DAMN GOOGLE ICON!
Favorite Quotes:Gandalf: You cannot pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
I wrote triangle-triangle collision. Go here for source and a demo.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement