![]() |
Our ray intersection test is similar in spirit to intersecting a ray
with a height field using a regular grid over the base plane. We will
take advantage of an implicit triangular grid formed by the
barycentric coordinates. We choose a subdivision
amount
(Figure 4) and use dividing lines
for
which creates
grid
cells for each triangle. Each grid cell generates one
displaced microtriangle, as shown in Figure 5. The grid
is regular on the base triangle, but due to the interpolated surface
normals, it is irregular throughout space. Although it is irregular,
our restrictions limit the range of the displacement function
to
the interval
where a traversal algorithm is possible.
Much like standard grid traversal algorithms, there are two phases to the algorithm. First the start point must be initialized. Next the grid must be traversed, checking each cell for an intersection with the triangle it contains. The traversal algorithm will be described first in order to determine the quantities that need to be initialized.