THRESHOLD
Step through a ring into another world
three.js · Stencil portal · Gyroscope
(Overview)
A golden ring, with a whole world on the other side.
Threshold is a doorway. From outside, the ring shows a slice of somewhere else, and nothing around it. Step through and that world wraps right round you: a ringed planet on one side, a neon city on another, twin suns setting behind.
On a phone you look around by turning your body, because the gyroscope steers the view. Turn back to face the ring and it has become a porthole onto the room you left, filled by your phone's camera. It's a single web page, with no app, no login and nothing to download.
(How it plays)
- ◯Find the ring and drag, or turn your phone, to look round it
- →Step through to cross into the world
- ↻Look around the full 360°
- ◉Turn back and the ring shows your camera, if you allow it


Cut a hole in the scene
The portal is a masking trick. An invisible disc inside the ring marks its own pixels, and the far world, painted on the inside of a huge sphere, is drawn only where that mark is. So from any angle you see the world through the ring and nowhere else.
Cross the line
Every frame, the page checks which side of the ring you're on. The moment you cross, the rule flips: the world is drawn everywhere except the ring, and the ring shows your camera instead. The camera is only asked for as you step through, and the picture never leaves your device. Say no and the ring simply stays dark.
Work on every phone
iPhones don't support WebXR, the browser standard for AR, and a plain, smooth ring gives image tracking almost nothing to lock on to. So the core runs on the gyroscope, which every phone has. Anchoring the ring in your actual room is the next step, and it will need an ornate, patterned ring for the camera to follow.
