Visualizations
203 / 500

203 · Illusions

Rotating Snakes

A perfectly still image whose wheels turn wherever you are not looking.

A field of Kitaoka-style peripheral drift wheels, each ring built from snake-scale elements that repeat four tones: black, a dark tone, white and a light tone. Nothing on the canvas moves except the red fixation dot, yet every wheel outside your direct gaze drifts, and neighboring wheels are mirrored so they turn opposite ways. The leading explanation is that high contrast edges are processed a few milliseconds faster than low contrast ones, so after each eye movement black registers before the dark tone beside it and white before the light tone, which motion detectors read as a step. The panel applies that rule to whatever tone order you build and predicts the drift, a slow-motion transient replays the latency stagger as visible motion, and the counter-rotate slider spins the wheels for real so you can cancel the illusion and measure it.

Try it. Follow the hopping red dot, or move the pointer to fixate wherever you like. Hover (or tap Controls) for presets, layouts, color or gray, and sliders for segments, rings, edge width, contrast and counter-rotation; click a swatch to swap two tones. Keys: R reverses every wheel, T plays the slow-motion transient, L cycles layouts, C toggles color, 1 to 5 pick presets, arrows change rings and segments.

  • Peripheral drift illusion
  • Contrast-dependent latency
  • Vector sprite rendering
  • Motion nulling

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 Rotating Snakes style peripheral drift illusion with JavaScript and the HTML canvas element: a completely still image whose wheels seem to turn when you are not looking straight at them. 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:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and redraws on resize. Nothing animates.
- Write a function that draws one wheel: several concentric rings, and in each ring a repeating sequence of four tones in this exact order: black, dark gray, white, light gray. Make black and white thin (about 15 percent of each element) and the two grays wide.
- Give inner rings fewer elements so every element is roughly as long as its ring is wide, and offset alternate rings by half an element.
- Tile the screen with wheels, mirroring every other one (scale(-1, 1)) so neighbors turn opposite ways. Add a small red dot to look at.

Once that works, make it beautiful:
- Curve the boundaries between tones (shift each boundary's angle by a small amount that depends on the square of the position across the ring) so the elements look like snake scales, and make the black and white stripes slightly fatter in the middle.
- Offer Kitaoka's color version: replace dark gray with a blue and light gray with a yellow of similar brightness.
- Add a key that reverses the tone order, and notice that the drift flips. Add one that swaps the white and light gray, and notice that it almost vanishes.
- Render each wheel once to an offscreen canvas and reuse it.

Explain in short code comments why the order matters: drift runs from black toward dark gray and from white toward light gray, probably because high contrast edges are processed slightly faster. When you're done, tell me how to open it and suggest three directions I could take it next, such as a slider that really counter-rotates the wheels until the illusion cancels, a linear version made of bands, or a slow-motion replay of the latency explanation.
PreviousMiura FoldMiura-ori, Yoshimura and waterbomb sheets fold with exact rigid-origami kinematics. NextMagnetic PendulumA pendulum over three magnets, and the fractal map of where every release point ends up.

Related visualizations

  • Waterfall IllusionIllusions Stare for twenty seconds, then watch a frozen picture drift the other way.
  • StroboscopeIllusions Wheels stop, creep and spin backwards under a film camera or a strobe.
  • Geometric IllusionsIllusions Six classic illusions on graph paper, and a lab that measures how much they fool you.
  • Lateral InhibitionIllusions Four brightness illusions, each predicted live by a model of retinal ganglion cells.
  • Hidden 3DIllusions A live magic eye picture: a turning 3D sculpture hidden in colorful noise.
  • Aperture ProblemIllusions One grating, one true motion, three holes that each report a different direction.
  • Point-Light WalkerIllusions Thirteen dots on black, and you see a person walking, running, dancing or carrying a box.
  • Op ArtGenerative art Riley and Vasarely style compositions that ripple, bulge and vibrate.
  • Anamorphic MirrorIllusions A wildly warped drawing that a chrome cylinder turns back into a picture.

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

← More from Emergent Mind Labs