At , orient the unit normal vector towards the eye. Define the unit directions from the reflecting point to the source and eye byThe incident propagation direction is . The law of specular reflection is , so is normal to the surface. Conversely, if the tangential components of vanish and , its unit-length summands have equal positive normal components and obey the reflection law. Therefore solve the two scalar equationsThe stated orientation condition gives . It removes the back-facing ambiguity, but not multiple images or caustics. Exclude and , where these directions are undefined.
At a root where the Jacobian matrix has rank two, the implicit function theorem makes the solution set a local curve in parameter space. Compute a unit tangent in its nullspace; equivalently take the normalized cross product of the two rows of . A continuation method predicts , where , then corrects with the Newton method applied to the three equationsThe last equation fixes a transverse section and allows tracing through a turning point of , where solving only for at successive fixed source parameters would fail. The corresponding space point is , with derivative along the traced parameter-space curve.
Find initial roots by subdividing the parameter cube, using interval arithmetic bounds on to discard impossible boxes and validated local solves in the remaining boxes. Trace in both directions, stop at the boundary or a recognized closed loop, and retain a record of traced boxes to avoid duplicates. Search the remaining boxes as well: starting from just one seed would miss disconnected closed reflection curves. Where loses rank, reduce the step and subdivide locally to find the outgoing branches instead of continuing a single guessed tangent. If physical visibility is required, discard roots for which either open segment or is occluded; test these segments against the surface or any supplied scene geometry.
Control the geometric approximation rather than just the parameter step. For any regular traced arc with a bound , the chord error bound gives an arc-to-chord Hausdorff distance at most . Budget, for example, half of for corrected-vertex error and half for chord error; accept a segment only whenBound the vertex error through the inverse transverse Jacobian matrix and a bound on , or use validated root enclosures. If analytic second-derivative bounds are unavailable, recursively subdivide and enclose each arc in a geometric tube of radius at most the remaining tolerance around its chord. A midpoint test alone is a useful heuristic but cannot certify the requested error for an arbitrary oscillatory curve.
The returned vertices and their ordered connecting segments give the reflection curve to the prescribed tolerance on every resolved branch. Finite certified termination requires regular evaluable patches, derivative or enclosure bounds, and finitely resolvable branches; eye-facing normals alone do not guarantee these properties. Singular components or an identically vanishing reflection constraint must be handled as such rather than silently reported as an ordinary curve.
Articles by others on the same topic
There are currently no matching articles.