View Single Post
  #8 (permalink)  
Old 09-12-2009, 06:19 AM
ceaser's Avatar
ceaser ceaser is offline
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 306
Default

Hi DeeCee

I use what you call the "brute force" method Firstly I calculate the area of the triangle using the 3 vertexes and then I calculate the area from the prism point (X & Y) to the respective triangle. If the 2 areas are the same, then the point is inside the triangle, but if the area from the prism point is larger than the triangle, then the point is outside the triangle, then the program tests the next triangle.

You are right, I test each triangle until the program finds the triangle where the point is inside the respective triangle.

I am sure there is a faster way. Maybe we should ask Klaus

Thanks
Michael
Reply With Quote