Planes, Trains, and Triangles
Little bit of subject line humor there =).
Ok, here I go with my question. I have a lot of 3d points, which i can form into a plane. I can also find out where a ray intersects the plane. What i want to do is feed a function with 3 points at a time (a triangle), and know if the point of intersection on the plane is within that triangle.
Code:
::strikes with bad ASCII art::
/ <-Ray
---------------------------------/----
\ / \
\ / \ <-Plane
\ / \
\ +---+/ \
\ \ /*\ \
\ +---+ <-Square \
\ \
----------------------------------------
*= instersect point.
Hope that makes sense... If anyone can help me out, I would be grateful =).
Z.
[edit]
instersect point? i cannot spell =).
Re: Planes, Trains, and Triangles
This solution is simple enough for me. You may try it.
If the triangle is A B C and the point is P, check if the area of triangle ABC is equal (difference 0.00001) same as sum of areas of triangles made by either side of triangle and point P
area(ABC) - [area(ABP)+area(ACP)+area(BCP)] < 0.00001
You may calculate area of triangle using Heron Formula:
http://mathworld.wolfram.com/HeronsFormula.html
I need a VB code to determine intersection point of line and a plane (triangle). Does anyone have it?