' '
preview

1. Mathematics

A plane can be uniquely defined in many ways:

  • Three points that are not lying on the same line.

  • One point and two non-parallel vectors.

  • One point and one normal vector (i.e. a vector perpendicular on the plane).

To solve the ray-plane intersection problem, using a point \(P\) and normal vector \(\vec n\) is the most practical approach.

Some point \(Q\) lies in the plane if the segment \(PQ\) is perpendicular on \(\vec n\). Determining perpendicularity is easy using the dot product:

\[Q \textrm{ lies in plane} \Leftrightarrow (Q-P) \cdot \vec n = 0\]

We also need \(Q\) to lie on the ray (having origin \(O\) and direction \(\vec\Delta\)):

\[Q \textrm{ lies on the ray} \Leftrightarrow \exists \; t \in \mathbb{R}. \; Q = O + \vec\Delta \cdot t\]

Substituting \(Q\) in the first equation yields

\[(O + \vec\Delta \cdot t - P) \cdot \vec n = 0\]

Solving for \(t\)

\[\begin{array}{rl} & (O + \vec\Delta \cdot t - P) \cdot \vec n = 0 \\ \\ \Leftrightarrow & (O - P) \cdot \vec n + \vec\Delta \cdot \vec n \cdot t = 0 \\ \\ \Leftrightarrow & t = \displaystyle \frac{(P-O) \cdot \vec n}{\vec\Delta \cdot \vec n} \end{array}\]

2. Summary

Given

  • a ray with origin \(O\) and direction \(\vec\Delta\);

  • a plane through point \(P\) and normal vector \(\vec n\).

To find the intersection between this ray and plane, perform the following calculations:

  1. Compute \(d = \vec\Delta \cdot \vec n\).

  2. If \(d = 0\), the ray runs parallel to the plane and hence there is no intersection.

  3. Compute

    \[t = \frac{(P - O) \cdot \vec n}{d}\]
  4. The ray hits the plane at position

    \[O + \vec\Delta \cdot t\]