<p>The permutation is described in section 3.6.2, page 158-159.</p>

<p>A reason behind this permutation is that a shear matrix (which involves dividing z component of ray direction) is computed to transform from world space to ray triangle intersection coordinate space.
Permuting the coordinates is to avoid divide-by-0 error by mapping nonzero component to +z.</p>

CC BY-SA 3.0
2018-03-13T17:50:58.540Z
2018-03-13T17:50:58.540Z
TheBusyTypist
<p>Where's this algorithm come from? Any references?</p>

<p>And a specific question, when the authors compute the transformation from world space to ray-triangle intersection coordinate space, what's the <strong>permutation</strong> step for?</p>

<raytracing><transformations><mesh>
What is the algorithm used in pbrt-v3 for triangle intersection?
jinglei
# What is the algorithm used in pbrt-v3 for triangle intersection?

(Asked by: username_0 on 2018-03-11)

Where's this algorithm come from? Any references?

And a specific question, when the authors compute the transformation from world space to ray-triangle intersection coordinate space, what's the **permutation** step for?

**Tags:** raytracing, transformations, mesh


---

## 1 answers

### Answer by username_1 on 2018-03-13. Score: 1 | Accepted answer

The permutation is described in section 3.6.2, page 158-159.

A reason behind this permutation is that a shear matrix (which involves dividing z component of ray direction) is computed to transform from world space to ray triangle intersection coordinate space.
Permuting the coordinates is to avoid divide-by-0 error by mapping nonzero component to +z.


---

