raphaelpaiva/JTrace — Issue #8: Orthogonal Tracer Bug
Author: raphaelpaiva
Created: 2011-12-13 01:10:48+00:00
State: open

How to reproduce:
* Create a Red Sphere centered in (0, 0, -10).
* Create a Blue Sphere centered in (0, 0, 0).
* Add the Blue Sphere to the scene.
* Add the Red Sphere to the scene.
* Render the scene with OrthogonalTracer.
* Blue Sphere should be rendered, but red is rendered instead.

This behavior is caused because there is no logic to determine witch object is in front. We just cast rays and the color that prevails is the color of the last one hit.

The Solution is to store the minimum ray parameter (t) and only detect a hit if the last t is less than the current t.

See Section 3.9, page 75 on tracing multiple objects.