As you may be able to tell from this screenshot, I am trying to make a physics engine for a platformer I am working on, but I have run into a definite problem: I need to be able
If you take the cross product of the two vectors:
p1 - p0
and
p2 - p0
where p0
, p1
and p2
are three vertices of the triangle, you'll get the normal. A triangle is considered to be pointing towards you if the vertices are ordered clockwise with respect to its outward normal. This is called the left hand rule. Imagine holding your left hand with your fingers curled from p0
to p1
, your thumb sticks out in the direction of the face normal: