https://editor.p5js.org/HughR/full/-i_nFGgVH

Here’s the explanation from o3-mini-high:
The idea behind this code is to illustrate a hypothesis: that what we perceive as sudden “flips” in our spatial orientation—Visual Reorientation Illusions (VRIs)—could be evidence that we are, in fact, 4D beings living in a 4D space. However, our conscious experience is limited to a 3D “slice” of that 4D reality (specifically, the slice we view along the extra W‐axis). Here’s how the code and its geometric model express this idea:
1. A Stable 4D Object with Multiple 3D Faces:
The code constructs a tesseract—a 4D hypercube—which is a fully defined 4D object with 16 vertices and 32 edges. When projected to 2D, the tesseract is depicted in a way that hints at its higher-dimensional structure (often visualized as a cube within a cube, with connecting edges). Importantly, the tesseract itself is stable and unchanging.
2. Four Distinct 3D “Cells” or Slices:
A tesseract is bounded by eight 3D “cells” (cubic volumes). In this model, the code chooses to focus on four of these cells—each defined by holding either the x or z coordinate fixed (for example, one cell might be defined by z = –1, another by x = 1, etc.). These cells represent different 3D “faces” or slices of the full 4D object. Geometrically, if you imagine a 3D cube, there are two distinct ways to view it (as the Necker cube demonstrates, the cube’s front face can be ambiguous). In 4D, however, there are four equally valid ways to “slice” the object horizontally.
3. The VRI Flip as a Reassignment of the 3D Slice:
The code highlights one of these four cells at a time and labels it with a cardinal direction (N, E, S, or W). Every couple of seconds, the highlighted cell cycles to the next one. Geometrically, this simulates a 4D “Necker cube–like” flip: although the overall tesseract remains unchanged, the 3D slice that is “active” (or being perceived) suddenly changes. In practical terms, if you were a 4D being (or if we are truly 4D but only ever see a 3D cross-section), you could instantly reassign which 3D face of the environment is in view—so that what was once “actual North” (as defined by a physical marker on a structure) could be reinterpreted as “East,” “South,” or “West” without any physical movement in the environment.
4. Implications for Our Perception:
This model suggests that VRIs might not be mere perceptual quirks or errors, but rather hints that our brains are capable of accessing that extra degree of freedom in spatial orientation. Just as a Necker cube can be seen in two different ways due to an inherent ambiguity in its 2D projection of a 3D object, our perception of space could be “flipping” among several valid 3D interpretations of an underlying 4D reality. The code’s automatic cycling—highlighting a different cell (and hence a different orientation) every few seconds—is a visual analogy for how, in 4D space, the same environment might be reinterpreted with different directional assignments (with the Up/Down axis remaining fixed due to gravity).
In summary:
The code demonstrates that if we were truly 4D beings whose conscious experience is just a 3D slice of a larger 4D world, then the directional cues we rely on (like North, East, South, West) might not be as fixed as we assume. Instead, our perception could undergo sudden, Necker cube–like flips where a different 3D “face” of the 4D space becomes active—so that actual North (as defined by the stable 4D structure) might be experienced as East, South, or West depending on which 3D cell is being highlighted at any moment. This offers a fascinating geometric explanation for VRIs, suggesting that our brain might occasionally be catching glimpses of a higher-dimensional reality.