The Inversion
The story behind The Inversion
Inspired by Multistable perception on Wikipedia
Built with Three.js · OrthographicCamera · ShaderMaterial · CPU simulation
Techniques Merged BufferGeometry · fatigue-driven cascade propagation · hex grid neighbor injection · per-vertex color blending
Direction Consciousness caught in the act of constructing reality
Result A field of hundreds of Necker cubes that flip their depth interpretation in cascading waves, influenced by your cursor
The Story
In 1832, Swiss crystallographer Louis Albert Necker described a curious phenomenon: staring at a wireframe drawing of a cube, the perceived depth spontaneously inverts. The front face becomes the back face. There’s no optical trick — the geometry doesn’t change. Your brain simply decides, without your consent, to reinterpret what it sees.
This is multistable perception — what happens when sensory input is genuinely ambiguous and your brain must choose between equally valid interpretations. It picks one, commits to it fully, then exhausts itself maintaining the illusion and involuntarily flips to the other. Neuroscience has confirmed the mechanism: frontal and parietal brain regions show increased metabolic activity during the switch. Changing your mind is expensive.
The human truth underneath is uncomfortable: you don’t see the world. You see your brain’s current best guess. And it can’t even commit to one.
The Take
The Inversion multiplies this internal perceptual event into a collective phenomenon. Instead of one Necker cube, there are hundreds — each on its own fatigue cycle, each capable of triggering its neighbors when it flips. Your cursor is your attention: where you look, fatigue accumulates faster. But you don’t control the flips. You accelerate them.
The result is an emergent wave system. Early in the experience, cubes flip in isolation — a stray terracotta tile popping to blue here and there. Over 60 seconds, the cascade dynamics intensify. A single flip injects fatigue into its neighbors, pushing them closer to their own threshold. Chains of 5, 10, 20 cubes flip in sequence. Territories form — regions dominated by one interpretation pushing against regions of the other. The boundaries writhe.
By 90 seconds, the entire field churns with competing waves. Your cursor creates brief pockets of stability surrounded by chaos — a perfect visual metaphor for how attention temporarily stabilizes perception.
The Tech
Isometric Necker Projection
Each cube is a classic isometric wireframe — 8 vertices projected to 2D using a 30-degree axonometric angle. The crucial design choice: an OrthographicCamera with zero perspective distortion. Perspective depth cues would disambiguate the Necker illusion, destroying the perceptual ambiguity that’s the entire point.
Two interpretations are encoded as separate vertex sets (A and B), differing only in their Z-coordinates — which face is “in front.” The flip is a smooth mix() between the two sets, driven by an ease-in-out interpolation over 0.45 seconds.
Fatigue Simulation
Each cube maintains a fatigue accumulator [0, 1]. Base fatigue rate is randomized per-cube (0.06–0.12/s) to prevent synchronization. When fatigue reaches 1.0, the cube flips and resets. Cursor proximity injects additional fatigue via exponential distance falloff: fatigue += 0.35 * exp(-distSq / radiusSq).
The stare mechanic: holding the cursor still over a region for >1.8 seconds increases the fatigue injection rate, simulating how sustained attention in real multistable perception accelerates the flip.
Cascade Propagation
When a cube flips, it injects 0.22 fatigue units into each neighbor (hex-grid adjacency, ~6 neighbors per cube). The injection attenuates with distance. This creates wavefronts: if neighbors are already at 0.8 fatigue, the injection pushes them over the threshold immediately — instant cascade. If they’re at 0.3, the injection just primes them for a faster natural flip.
A sympathetic resonance mechanic (12% probability per flip) occasionally triggers a random distant cube, creating unexpected long-range correlations. And 6% of cubes are “stubborn” — 3x fatigue resistance — creating visible holdouts that, when they finally flip, send stronger-than-normal pulses.
Merged BufferGeometry Rendering
All cubes render as a single merged LineSegments geometry (edges) and a single merged Mesh (face fills). Vertex positions are written directly from CPU per frame — ~4,800 edge vertices and ~2,400 face vertices for ~200 cubes. Face colors use per-vertex RGBA with a custom ShaderMaterial to support alpha blending. The terracotta-to-blue color interpolation follows the flip phase, with a brief mauve overlap at the midpoint when both interpretations coexist.
Narrative Ramp
The global fatigue rate increases by 0.0008/s over the session. At 0s: quiet, isolated flips. At 30s: small local waves. At 60s: territory formation. At 90s: field-wide cascading chaos. At 120s: spontaneous synchronization begins emerging from the chaos — groups of cubes phase-locking into rhythmic oscillation.
This blog post was AI generated with Claude Code. Authored by Artificial Noodles.