Three.js AR Examples
Augmented reality places 3D content over a view of the real world. These demos show the main building blocks: marker tracking that finds a fiducial marker and estimates its pose, face tracking for webcam filters, and room scanning that detects planes for placing objects.
A mixed-reality compositing demo shows how light estimation and shadows make virtual objects look as if they belong in the room. Each page explains the computer vision and maths involved, and the demos run with a webcam or simulated input.
Most viewed in augmented reality
All augmented reality demos
4 Demos
Three.js AR Marker Tracking (Fiducial Detection & Pose)
Marker-based AR from scratch in Three.js, where a synthetic phone-camera feed is thresholded, the marker quad is found from the dark blob's convex hull, a 5×5 fiducial ID is decoded through a homography, and the 6-DoF pose recovered from K⁻¹H anchors 3D content, checked against ground truth.
Three.js AR Face Filter (Webcam Face Tracking)
Snapchat-style AR face filters in Three.js driven by a lightweight tracker, with YCbCr skin segmentation, eye blobs for roll and yaw and dark-pixel mouth detection anchoring sunglasses, hats, cat ears and sparkles, on a synthetic subject or your webcam via getUserMedia.
Three.js AR Room Scanning (Spatial Mapping & Plane Detection)
Spatial mapping like ARKit and ARCore in Three.js, where a simulated depth sensor sweeps a room, hits accumulate into an 8 cm voxel map, and RANSAC detects floor, wall, table, seat and ceiling planes with labelled extents and coverage stats.
Three.js Mixed Reality Compositing (Light Estimation & Shadows)
Make virtual objects belong in a real scene in Three.js, with a split view comparing a naive paste against light estimation from camera pixels, a ShadowMaterial shadow catcher, an environment probe for reflections and matched sensor grain, plus WebXR immersive-ar where supported.