Function computes intersection of ray with triangle
http://geomalgorithms.com/a06-_intersect-2.html intersect_RayTriangle(): intersect a ray with a 3D triangle Input: a ray R, and a triangle T Output: *I = intersection point (when it exists) Return: -1 = triangle is degenerate (a segment or point) 0 = disjoint (no intersect) 1 = intersect in unique point I1 2 = are in the same planeint todo: when line lies in triangle, need to treat properly
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_line_type), | intent(in) | :: | line | line segment to check for interection |
||
type(tem_triangle_type), | intent(in) | :: | triangle | cube to check intersection of line |
||
type(tem_point_type), | intent(out), | optional | :: | intersect_p | intersection point if there is intersection |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | private | :: | u(3) | ||||
real(kind=rk), | private | :: | v(3) | ||||
real(kind=rk), | private | :: | n(3) | ||||
real(kind=rk), | private | :: | dir(3) | ||||
real(kind=rk), | private | :: | w0(3) | ||||
real(kind=rk), | private | :: | w(3) | ||||
real(kind=rk), | private | :: | r | ||||
real(kind=rk), | private | :: | a | ||||
real(kind=rk), | private | :: | b | ||||
real(kind=rk), | private | :: | uu | ||||
real(kind=rk), | private | :: | uv | ||||
real(kind=rk), | private | :: | vv | ||||
real(kind=rk), | private | :: | wu | ||||
real(kind=rk), | private | :: | wv | ||||
real(kind=rk), | private | :: | D | ||||
real(kind=rk), | private | :: | s | ||||
real(kind=rk), | private | :: | t | ||||
real(kind=rk), | private | :: | temp_p(3) |