ray_triangle_intersection.md 938 Bytes
Newer Older
yhesper's avatar
yhesper committed
1
2
---
layout: default
allai5's avatar
allai5 committed
3
title: Ray Triangle Intersection
yhesper's avatar
yhesper committed
4
permalink: /pathtracer/ray_triangle_intersection
allai5's avatar
allai5 committed
5
6
7
grand_parent: "A3: Pathtracer"
nav_order: 1
parent: (Task 2) Intersections
yhesper's avatar
yhesper committed
8
9
10
11
---

# Ray Triangle Intersection

allai5's avatar
allai5 committed
12
13
14
We recommend that you implement the *Moller-Trumbore algorithm*, a fast algorithm
that takes advantage of a barycentric coordinates parameterization of the
intersection point, for ray-triangle intersection.
yhesper's avatar
yhesper committed
15

allai5's avatar
allai5 committed
16
17
<center><img src="triangle_intersect_diagram.png" style="height:320px"></center>
<center><img src="triangle_intersect_eqns.png" style="height:400px"></center>
yhesper's avatar
yhesper committed
18
19
20

A few final notes and thoughts:

TheNumbat's avatar
TheNumbat committed
21
If the denominator _dot((e1 x d), e2)_ is zero, what does that mean about the relationship of the ray and the triangle? Can a triangle with this area be hit by a ray? Given _u_ and _v_, how do you know if the ray hits the triangle? Don't forget that the intersection point on the ray should be within the ray's `dist_bounds`.