eXt
- 4
- 0
Hi, how do I test if a point is inside a triangle? The point is assumed to be in the triangle's plane.
The discussion revolves around methods for determining whether a point is inside a triangle on a 2D plane. Participants explore various approaches, including geometric reasoning, linear algebra, and ray-casting techniques, without reaching a consensus on the best method.
Participants express various methods and ideas, but no consensus is reached on a single approach for determining point inclusion within a triangle. Different viewpoints and techniques are presented, reflecting ongoing exploration and debate.
Some methods discussed depend on specific assumptions about the triangle's representation and the geometric properties involved, which may not be universally applicable.
eXt said:What I'm trying to accomplish is to find if a point is within a geometric room consisting of several triangles. I am going to use Jordans curve theorem to find if it is so what I do is the following:
1) Cast a ray from the point (in an arbitrary direction) agains each plane the triangles are in.
2) If the ray intersects with the plane I calculate the point in the plane.
3) Now I need to figure out if this point is within the triangle or just in the plane.
4) And last, count each time the ray intersects with a triangle.
So, what I know about each triangle is it's 3 coordinates.
I've read about the following method but I'm not sure if its good or not:
Calculate a vector from the point to each corner of the triangle, if the sum of the angles between this vectors equals 360 degrees the point is inside.