Visualizations
335 / 500

335 · Physics

Hologram

Record an off-axis hologram of glowing points, then rebuild the 3D scene from it.

Each glowing point sends a spherical wave to a 256 by 256 film plate, where it meets a tilted plane reference beam, and the film keeps only the intensity |R + O|^2: a gray fringe texture that looks like nothing. Lighting the developed plate with the reference again brings the original object wave back on its own spatial frequency. The demo zero pads the plate, takes a 2D FFT, keeps the band around baseband (which removes the zero order and the twin image), and steps the light back toward the scene with the angular spectrum transfer function. Points at the chosen depth snap into focus while the rest blur into Fresnel rings, so the flat plate really does hold a 3D scene. Every point's light covers the whole plate, so cutting half of it away keeps every point, only blurrier.

Try it. Drag points in the scene view, or in the top-down bench view to change their depth; click empty space to add a point there and right-click or Shift-click to remove one. Drag the focus line on the bench (or up and down on the reconstruction, or use the arrow keys) to refocus. Scratch the plate to cut it away, use Cut half (H) and Restore (R), pick scenes with the chips or keys 1 to 4, and press Space to re-expose. Hover the plate for a magnifier on the fringes.

  • Fresnel holography with separable phase tables
  • Angular spectrum propagation with 2D FFTs
  • Band-limited off-axis reconstruction

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a digital holography simulator with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Use units where the wavelength is 1 and a hologram plate is a 256 x 256 grid with one sample per wavelength. Place 5 point sources about 2,000 to 3,000 units in front of the plate, within about 90 units of its center.
- At each plate sample, add up each point's spherical wave in the Fresnel approximation: phase = pi * ((x - xj)^2 + (y - yj)^2) / zj, amplitude constant. That is the object wave O.
- Add a tilted plane reference wave R = exp(2 pi i (0.29 x + 0.29 y)) and record the plate as H = |R + O|^2. Draw H as a gray image: it should look like fine diagonal fringes over a blotchy texture.
- Write a radix-2 2D FFT yourself. To reconstruct, multiply H by R, zero pad to 512 x 512, FFT, keep only spatial frequencies below about 0.125 cycles per sample (this removes the zero order and twin image), multiply by the angular spectrum transfer function exp(-2 pi i z (sqrt(1 - f^2) - 1)) with z equal to a point's depth, inverse FFT, and show the intensity in a second panel.

Once that works, make it beautiful:
- Add a focus slider so I can sweep z and watch points at different depths snap into focus while the others blur into rings.
- Light the reconstruction with a round, soft-edged beam (multiply the plate by a radial taper) so focused points are round instead of cross-shaped, and color it like a red laser with a little bloom.
- Let me drag the points around and erase parts of the plate with the mouse, recomputing as I go.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as reconstructing with a different wavelength, a top-down view of the optical bench, or recording a simple shape made of many points.
PreviousPixel SortingGlitch-art pixel sorting run live on painted photos, at any angle. NextOp ArtRiley and Vasarely style compositions that ripple, bulge and vibrate.

Related visualizations

  • Fourier DarkroomMath Paint on a picture's 2D spectrum and watch the inverse FFT redraw it instantly.
  • Hydrogen OrbitalsPhysics Exact hydrogen wavefunctions as glowing 3D point clouds, colored by quantum phase.
  • MoireIllusions Two sheets of fine lines beat into giant ghosts, and hide a secret message.
  • Optical BenchPhysics A blueprint ray tracer: prisms, lenses, mirrors and a fiber with real glass dispersion.
  • Phased ArrayPhysics Steer and focus a beam of sound with per-speaker delays in a live 2D wave simulation.
  • Aperture DiffractionPhysics Draw any aperture and see its diffraction pattern in true spectral color.
  • Hidden 3DIllusions A live magic eye picture: a turning 3D sculpture hidden in colorful noise.
  • Ice Crystal HalosPhysics Sundogs, arcs and halos built up live from millions of rays traced through ice.
  • Faraday WavesFluids A shaken dish of liquid locks into stripes, squares, hexagons and a 12-fold quasicrystal.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs