Stereo Rig Sandbox (r183 roadmap)

Side-by-side stereoscopic camera rig playground with eye-separation and convergence controls for tuning parallax comfort and depth intensity.

Key topics: three.js stereo camera, eye separation, convergence, stereoscopic rendering, r183

Overview

Every stereoscopic output (anaglyph, side-by-side 3D TVs, VR headsets) starts from a stereo camera rig: two cameras offset like a pair of eyes. How far apart they are and where they converge decides whether depth looks natural, flat or painful. This sandbox renders the left and right views of a THREE.StereoCamera side by side so you can tune those values and see the results directly.

How it works

StereoCamera takes a regular camera and produces cameraL and cameraR, updated each frame with stereo.update(camera). Two parameters matter most:

  • Eye separation (stereo.eyeSep) is the distance between the two virtual eyes. The human average is about 6.4 cm, so in a scene measured in metres a value near 0.064 gives natural depth. Larger values exaggerate depth and make the world feel miniature.
  • Convergence is the distance at which the two views line up, the "screen plane". Objects at that distance have zero parallax and appear at the display surface; nearer objects pop out in front and further ones recede behind. The demo draws a visible plane at the convergence distance so you can see where it lies.

Rather than rotating the eyes inwards (toe-in, which causes vertical misalignment), StereoCamera uses asymmetric off-axis frustums, which is the correct approach for comfortable stereo.

Exploring the demo

Compare the left and right halves and pick a ring near the convergence plane: it sits in the same place in both. Rings much nearer or further shift horizontally between the halves. Increase eye separation and watch those shifts grow; move the convergence plane and watch which objects line up change. Cross-eyed or parallel free-viewing lets you fuse the two halves without any hardware.

Practical advice

Keep most of the scene between the convergence plane and a moderate distance behind it, and avoid large negative parallax near the frame's edges. VR runtimes supply real per-eye matrices from the headset, but these concepts still apply to UI placement and comfort. See the colour-encoded version in anaglyph techniques and real headset rendering in the VR preview.

What this code does

- StereoCamera Split View: renders `StereoCamera.cameraL` and `StereoCamera.cameraR` side-by-side in one canvas.
- Eye Separation Control: adjusts `stereo.eyeSep` to tune interocular distance and stereo depth strength.
- Convergence Control: maps camera focus distance to a visible convergence plane for parallax calibration.
- Depth-Rich Scene: layered ring geometry provides near/far references to evaluate stereo comfort quickly.
- Practical Use: useful for prototyping stereoscopic camera rigs before integrating anaglyph, VR, or custom display pipelines.

JavaScript Implementation

ES6+
const stereo = new THREE.StereoCamera()
stereo.eyeSep = 0.08

camera.focus = 10
stereo.update(camera)

renderer.setViewport(0, 0, width / 2, height)
renderer.render(scene, stereo.cameraL)

renderer.setViewport(width / 2, 0, width / 2, height)
renderer.render(scene, stereo.cameraR)

Related demos

Trending this week

Most popular