Given in 3D:
-
a triangle
-
a point A inside the triangle
-
a direction vector D in plane of the triangle pointing from A in a direction towards the edges of the triangle
I am looking for an efficient and fast computer algorithm to find the intersection point T with the edge of the triangle.
For each edge of the triangle I can do a ray to line segment intersection test. But I am wondering if there is a more effecient and faster method to do this.
Best Answer
As mentioned by @Zonko, this looks like a $2D$ problem. You can just use the plane of the triangle or project everything to $\Pi_{xy}$ (assuming it does not lie in $\Pi_{xy}$ or $\Pi_{yz}$). Then, testing the ray for intersection with the three triangle edges is in $\mathcal{O}(1)$ and therefore optimal.