views:

42

answers:

1

I haven't taken any advanced math courses or anything (I'm still in high school) and I just don't really understand all the triangle collision systems online.

I have two triangular objects in a 2D space. How should I write Obj-C code so that a collision/intersection between the two can be detected? I'm stumped.

+1  A: 

Perhaps one of these techniques will help:

http://www.blackpawn.com/texts/pointinpoly/default.html

Basically, to simplify things you could start by just trying to figure out if each of the three points of a triangle is inside the other one - since having a corner from one or the other enter the other one is the only way they can be overlapping.

Kendall Helmstetter Gelner
The thing is... I don't really "understand" it, to the point that I can't convert it to Obj-C code. I haven't learned anything past Algebra 2, you see :D. Is there like a C version of CrossProduct()?
Nano8Blazex