Inspiration
Everyone has heard of the fourth dimension and almost nobody can picture it. The best explanation I know is the Flatland one: a flat creature can't see a cube, only the slice that passes through its world. We're that creature, one dimension up.
Reading that is one thing. I wanted to push the cube through the flat world with my own hands, and then have the same thing done to me. A headset is the only place that can happen.
4D apps aren't new. 4D Toys did it years ago and it's brilliant. What I wanted was the feeling of getting there yourself, starting from a single dot. I wanted a more engaging way to understand the concept of the 4th physical dimension, and to have more control over the shape and how it passes through our world.
The name comes from Charles Hinton, the man who gave us the word "tesseract". He needed names for the two directions we can't point in, and called them ana and kata.
What it does
AnaKata starts with one point floating in front of you. Pinch it and pull, and it stretches into a line. Pull the line and you get a square. Pull the square and you get a cube. No controllers, just your hands.
Then it asks what happens if you keep going. First you push the cube through a flat world and see what somebody living there would see: squares, rectangles or triangles, depending on how the cube goes in.
Then the same trick gets played on you. A tesseract passes through our 3D world, and you watch its slice change as you slide it along the fourth axis and turn it in directions that don't exist here.
After that you're let loose on a dozen or so 4D shapes, from a hypersphere to the 600-cell, to slice and spin however you like.
How I built it
AnaKata started on Apple Vision Pro, written in Swift and Metal. The shapes are real 4D meshes. Compute shaders cut them where they meet our 3D space, and what you see is that cut.
For Quest I didn't want a rewrite that would drift away from the original, so the Quest build runs the same Swift code. The Metal shaders are translated to GLSL at build time, a thin layer makes Vulkan look enough like Metal to keep the renderer happy, and OpenXR handles the headset and the hand tracking. A change on the Vision Pro side comes across without anybody porting it by hand.
I didn't own a Quest when I started, so the early work ran in the Meta XR Simulator on a Mac, with scripted hands doing the pinches. The real testing happened on a Quest 3S.
Challenges we ran into
Frame rate, first. The early builds on the Quest 3S ran the later scenes at 20-odd frames a second. It turned out every pixel was being shaded four times because of one anti-aliasing setting. Fixing that took the GPU from about 35 ms a frame to about 13.
Then eyes. On Vision Pro you look at a thing and pinch. The Quest 3S doesn't know where you're looking, so anything you grab from a distance had to be rebuilt around where your hand points, with bigger targets.
Some things only showed up on the device. One sentence in the app is enormous and far away, and on Quest the middle of it was missing because the far clipping plane sat at 100 m. Vision Pro never needed one.
The hardest part was pacing, not code. My early versions rushed, and in a headset people need time to look around before the next thing happens. A lot of the last month went on slowing down.
Accomplishments that we're proud of
The first thirty seconds. You pull a dot into a line, the line strikes the words, glass flies, and the letters tumble away and come back as the next sentence. I've watched it hundreds of times and I still like it. The goal was to provide a delightful and magical experience.
The whole trip from a point to a tesseract runs on a Quest 3S with bare hands, from the same code as the Vision Pro app.
And a small one: I tried to ban fade-outs. If something leaves, it leaves for a reason. It gets hit, or pulled, or it flies off.
What we learned
Slow down. Timings that looked fine on a monitor felt rushed in the headset.
Sound doesn't rescue a weak moment. I tried. It works when it marks something that happened, and it's noise when it fills a gap.
Get on the real device early. The simulator took me a long way, but frame rate and GPU quirks only show up on the headset.
Know what you're shipping before you polish. I spent days on details in the Vision Pro version that then had to be carried over to Quest in the last hours.
What's next for AnaKata
- Projections. Right now you meet 4D shapes by their slices. The next lesson is their shadows, the way a drawing of a cube is a flat shadow of the real thing.
- A steady frame rate in every scene on Quest.
- More shapes. The Klein bottle is already in the menu with "Coming soon" on it.
- A proper release on the Meta Horizon Store.
- 4D puzzles to give users more to do than just view the shapes after the onboarding experience.