Skip to main content

Back-face detection algorithm

Short answer

Back-face detection checks the dot product of view vector and outward surface normal. In standard viewing (looking along −z), a polygon is a back face if its plane coefficient C ≤ 0; such faces are culled.

Explain the back-face detection algorithm (method) used to detect visible surfaces.

A polygon surface is a back face if it faces away from the viewer. Such faces cannot be seen on a closed solid object, so they are removed before further processing. It is an object-space method.

Condition. Let the plane of the polygon be Ax + By + Cz + D = 0, with the outward normal N = (A, B, C) (vertices in counter-clockwise order seen from outside). Let V be the vector from the surface to the viewer (eye).

  • If V · N ≤ 0, the polygon is a back face (hidden).
  • If V · N > 0, it is a front face (possibly visible).

In viewing coordinates, where the viewer looks along the negative z-axis, V = (0, 0, 1), so V · N = C. The polygon is a back face if C ≤ 0.

        eye
         \  V
          \
   N ^     \
     |  front face (V.N > 0)
  ---+---------
   back face has N pointing away

Algorithm

  1. For each polygon, compute N = (V2 − V1) × (V3 − V1) from its vertices (or take A, B, C from the surface table).
  2. Compute V = eye position − a point on the polygon.
  3. Compute V · N.
  4. If V · N ≤ 0, discard the polygon, otherwise keep it for further processing.

Features: about half of the polygons of a closed convex object are removed, so rendering becomes roughly twice as fast. For a single convex polyhedron it gives the exact visible surfaces. For concave objects or overlapping objects it must be used along with another method (z-buffer, depth sorting).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 7 questions →