This proof-of-concept visualizes refraction and dispersion using a single incoming beam and a triangular prism. It’s designed to make the “why” visible: light bends when it changes medium, and different wavelengths bend by different amounts, so white light splits into a spectrum.
What you’re looking at
- Emitter (left): A single incoming beam aimed at the prism.
- Prism (center): A triangular glass body with an adjustable apex and rotation.
- Projection line (right): A fixed “screen” used to show where each wavelength lands after exiting the prism.
- White beam in → rainbow out: In White mode, the input is treated as a bundle of wavelengths that share the same entry path but diverge on exit due to dispersion.
What this POC proves
- Refraction is geometric and deterministic
The beam bends at the entry surface according to the interface normal and refractive index. - Dispersion produces the spectrum
Each wavelength uses a slightly different refractive index (a simple dispersion model), so the exit angles diverge into a fan. - Total internal reflection is real behavior, not a trick
At certain angles/materials, rays can reflect internally instead of exiting immediately. The POC counts these “TIR bounces.” - The projection screen makes the result measurable
The rainbow bar is not decoration; it’s a direct visualization of where the wavelengths hit a fixed plane, allowing a simple “spread” measurement.
Controls and what they change
- Light Mode
- White: traces many wavelengths and displays the spectrum fan + screen spread.
- Mono: traces one wavelength for clean refraction behavior.
- Mono wavelength (Mono mode only)
Shifts the color and slightly changes bending due to wavelength-dependent index. - Beam Angle
Rotates the incoming direction; the entire interaction shifts accordingly. - Prism Rotation
Rotates the prism body; changes entry/exit normals and the outgoing fan direction. - Prism Apex
Changes prism geometry; affects deviation magnitude and spread. - Material
Changes the refractive index baseline and dispersion strength (Crown vs Flint vs Diamond, etc.). - Dispersion Gain
Exaggerates or reduces the wavelength-dependent portion of refraction (useful for readability). - Auto-align
Keeps the prism positioned so the beam intersects it reliably. Turning it off allows “miss” cases.
Readouts
- Hits prism: whether the ray actually intersects the prism geometry.
- Exit angle: the outgoing direction (computed from the traced ray).
- Spread (white): the distance between highest and lowest wavelength hits on the projection screen.
- TIR bounces: how many internal reflections occurred before exit (if any).
This is intentionally a clean physics-first visualization: one beam in, prism interaction, measurable spectrum out.