Master Three.js and WebGL
Explore a comprehensive collection of production-ready Three.js examples. From basic geometry to advanced physics and custom shaders, everything you need to build the modern web is here.
Basics
Explore 15 basics examples and code samples.
Rotating Cube in Three.js (Beginner Demo)
Beginner-friendly Three.js rotating cube example that teaches the core Scene, PerspectiveCamera, WebGLRenderer, mesh setup, and real-time animation loop used in most WebGL apps.
Three.js Timer vs Clock Delta Demo (r183)
Side-by-side demo showing why r183 recommends `THREE.Timer` for frame-delta reads, especially when multiple systems request timing in the same animation frame.
Three.js Sphere Texture Mapping Demo
Detailed Three.js sphere texture mapping demo using UV coordinates and procedural CanvasTexture generation. Shows texture wrapping modes, anisotropic filtering, and realistic material response on curved geometry.
Three.js Wireframe Toggle (Torus Demo)
Interactive Three.js wireframe demo showing how to toggle `material.wireframe` on a torus mesh via keyboard and GUI controls to inspect topology and triangle flow.
Three.js Torus Knot Geometry Demo
Interactive torus knot geometry demo showcasing Three.js TorusKnotGeometry with parametric generation, animation, and standard PBR material shading.
Ambient vs Directional Light in Three.js
Three.js lighting fundamentals demo comparing ambient fill light and directional key light on a shaded sphere to show contrast, shadow depth, and readable form.
Three.js GridHelper + AxesHelper Demo
Three.js scene debugging demo using GridHelper and AxesHelper to visualize world orientation, unit scale, and object alignment while orbiting the camera.
3D Point Cloud Visualization in Three.js
High-performance JavaScript 3D point cloud visualization built with Three.js BufferGeometry and PointsMaterial, demonstrating GPU-efficient rendering, per-vertex color, and interactive camera navigation.
Orbit Controls + Axes Helper (Three.js)
Learn OrbitControls camera interaction with a rotating cube and AxesHelper reference, including pan, zoom, and orbit behavior for intuitive Three.js scene navigation.
Three.js Plane Shadows (Cast & Receive)
Core Three.js shadow mapping demo showing how to enable renderer shadows, configure directional lights, and set cast/receive shadow flags on mesh objects for grounded scenes.
MeshNormalMaterial Demo in Three.js
MeshNormalMaterial debugging demo with a rotating torus knot that visualizes surface normals directly, helping diagnose topology, smoothing, and orientation issues.
Three.js InstancedMesh Grid Demo
Performance-oriented Three.js instancing demo rendering hundreds of cubes in a grid using InstancedMesh and per-instance transforms for low draw-call overhead.
Three.js Box Wireframe Geometry Demo
Minimal wireframe cube example using MeshBasicMaterial to visualize triangle edges, geometry structure, and unlit rendering behavior in Three.js.
Three.js Materials Comparison Gallery
Side-by-side Three.js materials comparison across MeshBasicMaterial, MeshLambertMaterial, MeshPhongMaterial, and MeshStandardMaterial under shared lighting.
Three.js Primitive Geometries Showcase
Rotating Three.js primitive geometry showcase comparing box, sphere, cone, and torus meshes under consistent lighting and material settings.
Lighting
Explore 13 lighting examples and code samples.
Three.js Point Light Interactive Demo
Interactive three.js point light with real-time controls for position, color, and intensity. Features point light helper visualization and mouse tracking.
Directional Shadow Visualizer
Inspect directional light shadow camera and map size.
Spotlight Follow Cursor
Spotlight target follows the mouse; tweak angle and penumbra.
Flickering Torch
Noise-based point light flicker simulating a handheld torch.
Three.js Day-Night Cycle Simulation
Dynamic Three.js day-night cycle demo animating sky color, sun position, and light intensity to simulate sunrise, noon, sunset, and nighttime transitions.
Multiple Light Blending
Add/remove multiple colored lights and blend their effects.
Disco Lights
Patterned color-cycling lights with tempo and patterns.
Volumetric Light Shafts
Fake god rays with additive cone; adjust density and decay.
Fog Scattering Playground (r183-inspired)
Atmospheric spotlight demo using exponential fog and additive beam scattering to visualize how light volumetrics react to fog density and penumbra.
Volumetric Spotlight Lab (r183 roadmap)
Dense spotlight beam demo combining real spotlight shadows with additive volumetric cone scattering and animated occluders for dynamic light shafts.
Soft Shadows in Three.js
Advanced three.js soft shadow techniques with PCF shadow mapping, dynamic shadow softness control, and real-time shadow quality comparison.
Neon Glow Text
Emissive neon-style text with adjustable glow intensity.
Depth of Field Gallery
Post-processing depth of field effect with objects at varying distances.
Camera Controls
Explore 5 camera controls examples and code samples.
Three.js Orbit Controls Playground Demo
Interactive Three.js OrbitControls camera playground covering damping, auto-rotation, zoom limits, and polar-angle constraints for smooth navigation in real-world scenes.
Three.js First-Person Camera (WASD + Mouse)
Three.js first-person camera controller with WASD movement, pointer lock mouse look, and collision boundaries for immersive FPS-style navigation in browser scenes.
Dolly Zoom (Vertigo Effect)
Camera technique that changes FOV while adjusting distance to maintain object size.
Advanced Anaglyph Stereo Techniques (r183)
Red-cyan stereoscopic demo using `AnaglyphEffect` with configurable depth presets to compare subtle, balanced, and deep parallax setups.
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.
Animation
Explore 1 animation examples and code samples.
Particle Systems
Explore 3 particle systems examples and code samples.
Three.js Snowfall Particle System Demo
Real-time snowfall particle system in Three.js with wind drift, vertical fall velocity, sprite-based flakes, and continuous particle recycling for stable performance.
Fireworks
Interactive fireworks show with particle explosions and physics.
Three.js Galaxy Generator Demo
Procedural spiral galaxy generator in Three.js with configurable arms, radial distribution, color gradients, and high-particle-count rendering for astronomy-inspired visuals.
Physics Simulation
Explore 2 physics simulation examples and code samples.
Materials & Textures
Explore 6 materials & textures examples and code samples.
Environment Map (HDRI)
Real-time reflections using cube camera and procedural skybox.
Procedural Noise Texture
Shader-based fractal noise with multiple octaves and color modes.
Water Realism Upgrade (r183-inspired)
Real-time water surface demo using Three.js `Water` with animated wave uniforms, distortion controls, and reflective highlights around a lit island scene.
Env IBL on Lambert vs Phong (r183)
Side-by-side material comparison showing environment-based lighting reflections on `MeshLambertMaterial` and `MeshPhongMaterial` using a live cubemap probe.
Clearcoat + Anisotropy Lab (r183 roadmap)
Side-by-side physical material comparison that demonstrates brushed anisotropic highlights with a clearcoat layer versus a baseline PBR material.
Iridescence Thin-Film Materials (r183 roadmap)
Interactive `MeshPhysicalMaterial` lab that showcases angle-dependent thin-film color shifts with iridescence IOR and thickness controls.
Performance & Optimization
Explore 8 performance & optimization examples and code samples.
BatchedMesh Opacity + Wireframe (r183)
Performance-focused Three.js `BatchedMesh` demo showing per-instance opacity animation via `setColorAt(Vector4)` and live wireframe mode toggling.
Instancing vs BatchedMesh Benchmark (r183 roadmap)
Split-screen benchmark comparing `InstancedMesh` and `BatchedMesh` with synchronized animation, live update timings, and draw-call counters at high instance counts.
Three.js Level of Detail (THREE.LOD Performance)
Level-of-detail rendering in Three.js with 600 procedural asteroids, each a THREE.LOD with 20k / 1.3k / 80-triangle meshes, with colour-coded levels, distance and hysteresis tuning and live triangle and draw-call counts.
Three.js Instancing Performance (100k Objects)
Render up to 100,000 cubes in Three.js and compare individual meshes, InstancedMesh with CPU-updated matrices, and InstancedMesh animated entirely on the GPU from gl_InstanceID, with draw calls and render-time stats.
Three.js Frustum Culling Visualizer
See frustum culling at work in Three.js, with a top-down inset showing the camera frustum and objects coloured visible or culled, live draw-call and triangle counts, and toggles for culling and the far plane.
Three.js Texture Memory & Compression Formats
Measure texture memory in Three.js across many unique textures in RGBA8, RGBA5551 and GPU-compressed BC1, with mipmaps on or off, resolution choices, a packed atlas mode, and upload time and GPU texture counts.
Three.js Memory Management (dispose() and Leaks)
Watch GPU memory in Three.js as scenes are created and torn down continuously, comparing proper dispose() of geometries, materials and textures with the common leak of only removing objects from the scene, charted from renderer.info.memory.
Three.js GPU Particles (GPGPU, 1 Million Particles)
Up to one million particles simulated entirely on the GPU in Three.js with GPUComputationRenderer, using position and velocity float textures, curl-noise flow, a moving attractor and lifetime respawn, drawn as additive points.
Rendering Techniques
Explore 15 rendering techniques examples and code samples.
Reversed Depth + PostFX Compatibility (r183)
Long depth-range scene rendered with `reverseDepthBuffer` and `EffectComposer`, demonstrating post-processing compatibility under reversed depth.
TRAA vs SMAA Comparison (r183 roadmap)
Split-screen anti-aliasing comparison with temporal accumulation AA on the left and SMAA post-processing on the right for visual quality tradeoff analysis.
Shadow Map Types Comparison (r183 roadmap)
Three-way split viewport that compares `PCFShadowMap`, `PCFSoftShadowMap`, and `VSMShadowMap` on the same animated scene and light setup.
Three.js Ambient Occlusion (GTAO vs SSAO)
Screen-space ambient occlusion in Three.js comparing GTAOPass (ground-truth horizon-based AO with Poisson denoise) and SSAOPass (hemisphere kernel) on a crevice-heavy scene, with AO-only and no-AO views.
Three.js Screen-Space Global Illumination (SSGI)
One-bounce screen-space global illumination in Three.js that gathers light reflected by nearby visible pixels from color, depth and normal buffers, with temporal accumulation and visible color bleeding in a Cornell box.
Three.js Temporal Anti-Aliasing (TAA from Scratch)
Temporal anti-aliasing implemented by hand in Three.js, with Halton sub-pixel jitter via setViewOffset, an exponential history buffer and neighbourhood clamping, shown split-screen against the raw aliased frame.
Three.js Cascaded Shadow Maps (CSM)
Cascaded shadow maps in Three.js with the CSM addon, keeping shadows sharp near the camera across a 180 m avenue, with adjustable cascades, practical/uniform/logarithmic splits, cascade fading and frustum visualization.
Three.js Deferred vs Forward Rendering (256 Lights)
Compare deferred and forward shading in Three.js, using a 3-target MRT G-buffer (albedo, normal, position) lit by up to 256 point lights in one full-screen pass, against standard forward point lights.
Three.js Tiled Forward+ Lighting (1024 Lights)
Tiled forward (Forward+) lighting in Three.js, where the CPU bins up to 1024 point lights into 32-pixel screen tiles each frame and fragments shade only their tile's lights, with a per-tile heatmap and a brute-force comparison.
Three.js Order-Independent Transparency (Weighted Blended OIT)
Weighted blended order-independent transparency in Three.js (McGuire & Bavoil), with accumulation and revealage render targets composited over the opaque scene, compared with sorted alpha blending on intersecting glass.
Three.js Depth Peeling (Exact Transparency)
Depth peeling in Three.js, rendering transparent geometry in N passes where each peels the next-nearest layer using the previous layer's depth texture, then compositing back to front for correctly ordered transparency.
Three.js Reflection Probes (Box-Projected Cube Maps)
Local reflection probes in Three.js, with a CubeCamera in each of two differently lit rooms and parallax-corrected box projection for a moving chrome sphere and glossy floors, blending probes across the doorway.
Three.js IES Light Profiles (Photometric Lighting)
Photometric lighting in Three.js from IES LM-63 profiles, using an included parser, candela lookups per vertical angle in a custom shader, photometric web visualizations, four fixture types and loading of your own .ies files.
Three.js GPU Path Tracer (Progressive Cornell Box)
Progressive GPU path tracing in a Three.js fragment shader, rendering an analytic Cornell box with diffuse, mirror and glass materials, next-event estimation on the area light, Russian roulette and running-average accumulation.
Three.js Contact Shadows (Soft Grounding Shadows)
Soft contact shadows in Three.js, rendered from below the floor with an orthographic camera, converted from depth to darkness, blurred with separable passes and projected onto a ground plane, compared with directional shadow maps.
Geometry & Modeling
Explore 13 geometry & modeling examples and code samples.
Curve Modifier Playground (r183 roadmap)
Flow-based geometry deformation demo that moves and bends a mesh along an editable Catmull-Rom spline path in real time.
Three.js CSG Boolean Operations (Union, Subtract, Intersect)
Real-time constructive solid geometry in Three.js using three-bvh-csg, combining shapes with union, subtraction, intersection and XOR while the tool animates, with per-operand materials and timing.
Three.js Marching Cubes Playground (Metaballs & Implicit Surfaces)
Interactive marching cubes in Three.js polygonizing metaballs, gyroids, Schwarz P minimal surfaces, torus pairs and noise blobs, with live iso level, grid resolution and per-vertex colors.
Three.js Voxel Terrain Editor (Chunked Meshing)
Editable voxel world in Three.js with procedural terrain, caves and water, chunked face-culled meshing, DDA voxel picking and dig/build brushes that rebuild only the chunks they touch.
Three.js SVG Extrusion (SVGLoader + ExtrudeGeometry)
Turn SVG paths into 3D solids in Three.js with SVGLoader and ExtrudeGeometry, keeping holes and fill colors, with depth, bevel and curve-detail controls and loading of your own SVG files.
Three.js Lathe & Sweep Surfaces
Revolve spline profiles into vases, goblets, chess pawns and bells with LatheGeometry, or sweep star, gear and flower cross-sections along 3D paths with twist and taper using Frenet frames.
Three.js Parametric Surface Gallery (Klein Bottle, Boy's Surface)
Gallery of famous parametric surfaces in Three.js (Klein bottle, Möbius strip, Boy's surface, Dini's surface, a seashell, Enneper's minimal surface and a breather), with a UV checker and a growth animation.
Three.js SDF Mesh Deformer
Deform meshes in Three.js with animated signed distance fields (sphere, rounded box or torus) in shrink-wrap dent, attract, repel and twist modes, with vertices colored by displacement.
Three.js Delaunay & Voronoi Terrain (TIN)
Triangulated irregular network terrain in Three.js using Bowyer–Watson Delaunay triangulation of uniform, Poisson-disc or feature-adaptive samples, with the Voronoi dual drawn beneath.
Three.js Isosurface from Volume (Surface Nets vs Marching Cubes)
Extract meshes from 3D noise volumes (asteroids, caves, overhanging terrain and gyroid lattices) in Three.js with a hand-written Surface Nets mesher shown next to Marching Cubes on the same field.
Three.js Curve & Spline Editor (Catmull-Rom, B-Spline)
Interactive spline editor in Three.js with draggable control points (TransformControls), centripetal, chordal and uniform Catmull–Rom, cubic B-spline and polyline curves, tube meshes, Frenet frames and a constant-speed rider.
Three.js Mesh Edge Skeleton (Feature, Silhouette & Boundary Edges)
Extract a mesh's edge skeleton in Three.js, covering crease-angle feature edges, open boundary edges and view-dependent silhouette edges recomputed every frame, plus a metal strut-sculpture mode.
Three.js Shape Inflation & Normal Offset
Inflate flat shapes into balloons in Three.js by solving a pressure equation on a Delaunay mesh, and compare normal-offset growth and shrinkage of meshes with split vs averaged normals.
Retro / Demoscene
Explore 1 retro / demoscene examples and code samples.
Procedural Generation
Explore 6 procedural generation examples and code samples.
Random Terrain
Fractal noise-based terrain generation with vegetation and biomes.
Rain with Splashes
Fast falling raindrops with wind and fog; reset on ground contact.
Fountain Emitter
Upward particle fountain with gravity and per-particle lifetime.
Animated Texture Scroll
Scroll a checker texture across a cylinder by animating UV offsets.
Starfield Warp
Infinite starfield moving towards the camera with wraparound.
Realistic Animated Grass Field in Three.js
Immersive grass field with advanced wind simulation, realistic blade shapes, natural color variation, and interactive camera controls.
Post-Processing
Explore 11 post-processing examples and code samples.
Bloom Glow
HDR bloom post-processing effect with threshold and intensity controls.
Motion Blur
Velocity-based blur trails created by blending current and previous frames with custom shader.
Depth of Field Focus
Bokeh depth of field pass with smooth auto-focus and click-to-focus controls across layered geometry.
Glitch VFX Playground
Neon city scene routed through DigitalGlitch shader with burst, pulse, and wild distortion modes.
Film Grain Studio
Cinematic scene layered with animated film grain, scanlines, and color tint controlled through a custom shader.
Color Grading Studio
Interactive slope-offset-power grading pipeline with exposure, saturation, and temperature controls.
Screen Space Reflections
Real-time reflections using render targets to create realistic water surface reflections with interactive controls.
FXAA/SMAA Antialiasing
Advanced antialiasing techniques (FXAA and SMAA) to reduce jagged edges in post-processing.
Chromatic Aberration
Simulate lens distortion effects where colors bleed at the edges of high-contrast objects.
Vignette & Lens Distortion
Camera imperfections including dark edges (vignette) and radial lens warping.
Retro Pass Pipeline (r183-inspired)
CRT-style post-processing chain built with `EffectComposer`, combining scanlines, barrel curvature, chromatic separation, grain, and vignette.
Audio Visualization
Explore 12 audio visualization examples and code samples.
Three.js Music Visualizer (Web Audio FFT)
Real-time Three.js music visualizer driven by Web Audio API FFT analysis, with animated frequency bars, color modes, and sensitivity controls for audio-reactive scenes.
Audio Reactive Particles in Three.js
Audio-reactive particle simulation using Web Audio frequency bands (bass, mid, treble) to drive motion, bursts, color shifts, and lighting changes in a real-time Three.js scene.
Three.js Oscilloscope (Waveform & Lissajous Figures)
A glowing CRT oscilloscope in Three.js that draws live Web Audio waveforms with zero-crossing triggering, phosphor persistence and bloom, plus an XY mode tracing Lissajous figures from two oscillators in simple frequency ratios.
Three.js Beat Detection (Onset Detection & Tempo Estimation)
Real-time beat detection in Three.js, comparing each frame's band energy from a Web Audio drum machine against a running average to detect onsets, with pulsing geometry, an energy history graph and tempo estimated from inter-onset intervals.
Three.js 3D Spectrogram (Waterfall FFT Plot)
A scrolling 3D spectrogram in Three.js, with frequency across, time receding and level as height and colour, showing melodies, drums, chirp sweeps and harmonic series analysed by a 2048-point FFT on a log or linear axis.
Three.js Audio Landscape (Synthwave Spectrum Terrain)
Fly over a synthwave terrain built from music in Three.js, where every new row of mountains is the current audio spectrum, mirrored into a valley road under a striped sun with a neon grid and bloom.
Three.js Sound Wave Propagation (2D Wave Equation)
Simulate acoustic waves in Three.js with a 180×180 finite-difference wave equation, showing double-slit diffraction, two-source interference, a parabolic reflector and a moving source's Doppler effect, with an audible listener probe.
Three.js Virtual DJ Mixer (Two Decks, Crossfader, Filters)
A 3D DJ console in Three.js with two generated Web Audio loops on spinning turntables, an equal-power crossfader, per-channel volume and low-pass filters, VU meters, tempo control and beat sync.
Three.js Piano Visualizer (Playable 3D Keyboard)
A playable 3D piano in Three.js covering G3 to C6, with hinged keys, falling note bars, pitch-coloured particle bursts, autoplay of public-domain melodies, and computer-keyboard or click input through Web Audio.
Three.js Voice Visualizer (Formants, Pitch & Speech Recognition)
Speech-to-visuals in Three.js, tracking pitch by autocorrelation and the first two formants from the spectral envelope to place the voice on a 3D vowel chart, with optional microphone input and Web Speech API words floating up as text.
Three.js 3D Drum Machine (16-Step Sequencer)
A playable 3D drum machine in Three.js with six synthesised instruments on a 16-step grid of pads, click-to-toggle, swing, presets, randomise, and look-ahead scheduling on the Web Audio clock for tight timing.
Three.js Audio-Reactive Tunnel Flight
Fly through a winding audio-reactive tunnel in Three.js, where each ring of glowing bars freezes the spectrum as you pass it, flight speed and bloom pulse with the bass, and a 128 BPM loop is generated live with Web Audio.
WebGL Techniques
Explore 16 webgl techniques examples and code samples.
Render Targets
Render to texture technique showing a spinning cube rendered to texture and applied to multiple objects.
MRT G-Buffer Visualizer (r183 roadmap)
WebGL2 multiple-render-target demo that captures normal and depth attachments and visualizes them alongside the beauty pass in a four-panel layout.
Three.js Multi-Pass Rendering (Stencil Masking & Depth Pre-Pass)
Multi-pass rendering in Three.js with a stencil-buffer X-ray lens that reveals hidden internals only inside a mask, plus an optional depth pre-pass that cuts overdraw by shading each pixel once.
Three.js Geometry Shader Effects (Emulated in WebGL)
Geometry-shader-style effects in Three.js (exploding triangles, shrinking to centroids, extruded spikes and noise displacement) emulated by baking per-face attributes into vertex data, since WebGL has no geometry stage.
Three.js GPGPU Compute (Cellular Automata on the GPU)
Compute-shader-style GPGPU in Three.js, running Conway's Life, Brian's Brain and a 16-state cyclic automaton on grids up to 2949×2048 with ping-pong render targets, many generations per frame and painting with the pointer.
Three.js Custom & Instanced Attributes (300k Grass Blades)
Custom vertex attributes in Three.js, with a field of up to 300,000 wind-blown grass blades from one InstancedBufferGeometry using a per-vertex tip weight and per-instance offset, height, phase, colour and lean in an interleaved buffer.
Three.js Uniform Buffer Objects (UniformsGroup / UBO)
Share scene data across 400 materials in Three.js with a WebGL2 uniform buffer (UniformsGroup), holding four lights, fog and time in one std140 block uploaded once per frame, compared with per-material uniforms.
Three.js Transform Feedback Particles (Raw WebGL2)
GPU particle physics with WebGL2 transform feedback alongside Three.js, where a vertex shader writes updated positions and velocities into a second buffer that is then drawn directly, for up to a million particles with no CPU readback.
Three.js Occlusion Queries (WebGL2 ANY_SAMPLES_PASSED)
Hardware occlusion queries in Three.js, wrapping each object's draw in a WebGL2 query via onBeforeRender/onAfterRender, reading results asynchronously and showing visible, occluded and frustum-culled objects in a top-down inset.
Three.js Conditional Rendering (Occlusion-Query Proxies)
GPU-driven visibility in Three.js that emulates conditional rendering, querying cheap bounding-box proxies after the occluders and submitting expensive 100k-triangle meshes only when their proxy was visible last frame.
Three.js Vertex Array Objects (VAO vs Re-Binding, Raw WebGL2)
Measure what vertex array objects save in raw WebGL2 alongside Three.js, drawing up to 20,000 meshes either with one bindVertexArray per draw or by re-binding buffers and attribute pointers every time.
Three.js MRT GPU Picking & ID-Buffer Outlines
Multiple render targets in Three.js, where one pass writes colour, normals and a 24-bit object-ID buffer, used for pixel-exact GPU picking with readRenderTargetPixels and selection outlines from edge detection on the ID buffer.
Three.js Framebuffer Blitting (MSAA Resolve & Magnifier)
WebGL2 blitFramebuffer with Three.js, compositing a split view of single-sample and 4× MSAA renders and a pixel magnifier entirely with framebuffer blits, using NEAREST or LINEAR filtering.
Three.js Texture Arrays (DataArrayTexture / sampler2DArray)
Bind many textures as one in Three.js with a DataArrayTexture, letting 1,600 instanced cubes each sample one of 16 layers via a per-instance attribute in a single draw call, compared with 16 separate textures and materials.
Three.js Environment Map Arrays (Cubemap Arrays Emulated)
Many environment maps in one sampler in Three.js, with eight procedural skies stored as equirectangular layers of a mipmapped texture array so 40 reflective spheres pick their own environment and roughness in one draw call.
Three.js Vertex Animation Textures (Buffer Textures Emulated)
Large per-vertex datasets in textures in Three.js, where a verlet cloth simulation is baked into a float data texture and replayed on 400+ instanced flags with texelFetch by vertex index and frame, with no CPU work per frame.
Scientific & Educational
Explore 28 scientific & educational examples and code samples.
Three.js Solar System Simulation
Educational Three.js solar system simulation featuring orbital motion, planet scaling relationships, moon systems, and sun-driven dynamic lighting for space visualization.
Three.js DNA Double Helix (Interactive Molecular Model)
Interactive Three.js DNA double helix with complementary A–T / G–C base pairs, sugar-phosphate backbones, adjustable twist and rise, and an animated unzipping strand separation.
Three.js Atomic Structure (Bohr Model Electron Shells)
Interactive Bohr-model atom in Three.js with a packed proton/neutron nucleus, tilted electron shells filled in aufbau order, orbiting electrons, and an optional probability cloud.
Three.js Crystal Lattice Viewer (SC, BCC, FCC, NaCl, Diamond)
Explore cubic crystal lattices in Three.js — simple cubic, body-centered, face-centered, rock salt, cesium chloride and diamond — with nearest-neighbour bonds, unit-cell outline and an exploded view.
Three.js Wave Interference (Double-Slit Ripple Tank)
GPU ripple tank in Three.js showing constructive and destructive interference from multiple coherent point sources, with adjustable wavelength, separation, phase, damping and an intensity view that reveals nodal lines.
Three.js Magnetic Field Lines (Bar Magnet Visualizer)
Trace magnetic field lines around bar magnets in Three.js with numerical integration, compare attracting, repelling and quadrupole arrangements, and watch particles flow from north to south.
Three.js Saturn Ring System (120k Keplerian Particles)
Saturn's rings in Three.js as 120,000 GPU-animated particles following Kepler's third law, with the C, B and A rings, the Cassini division, the Encke gap, shepherd moons and the planet's shadow across the rings.
Three.js Black Hole Gravitational Lensing (Ray-Traced Shader)
Real-time ray-traced Schwarzschild black hole in Three.js, with bent light paths, a photon ring, a Doppler-beamed accretion disk and a lensed starfield, all computed per pixel in a fragment shader.
Three.js Fractal Explorer (Mandelbrot, Julia, Burning Ship)
Interactive GPU fractal explorer in Three.js with smooth-colored Mandelbrot, Julia and Burning Ship sets, pointer-anchored zoom, drag to pan, preset locations and a live Julia constant.
Three.js Molecule Viewer (PDB Ball-and-Stick)
Three.js molecular viewer with a PDB parser, automatic covalent-radius bond detection, CPK coloring and ball-and-stick, space-filling and stick styles, with built-in molecules from water to C₆₀ and an α-helix.
Three.js 3D Periodic Table (118 Elements)
Interactive 3D periodic table in Three.js with all 118 elements as atlas-textured tiles, category highlighting, hover details, and animated transitions between table, sphere, helix and grid layouts.
Three.js 3D Function Plotter (z = f(x, y, t))
Type any expression and plot z = f(x, y, t) as an animated 3D surface in Three.js, with a safe built-in expression parser, height-based color ramp, contour lines and classic presets like Peaks and the monkey saddle.
Three.js Fibonacci Spiral & Golden Angle Phyllotaxis
Golden-ratio phyllotaxis in Three.js — grow a sunflower head, pinecone and sphere from the 137.5° golden angle, color the Fibonacci parastichies, and build the golden-rectangle spiral.
Three.js Lorenz Attractor & Chaos Visualizer
RK4-integrated strange attractors in Three.js — Lorenz, Rössler, Aizawa and Thomas — with fading trails and several nearby trajectories that show sensitive dependence on initial conditions.
Three.js Fluid Simulation (Stable Fluids, Navier–Stokes)
Real-time 2D Navier–Stokes fluid in Three.js using Jos Stam's Stable Fluids with vorticity confinement, three colored dye channels and a 3D height-field, plus shift-drag to stir.
Three.js Predator–Prey Ecosystem Simulation
Agent-based ecosystem in Three.js where rabbits graze regrowing grass and foxes hunt them, producing Lotka–Volterra-style population cycles shown on a live chart.
Three.js Traffic Flow Simulation (Phantom Traffic Jams)
Ring-road traffic in Three.js using the Intelligent Driver Model, where tiny perturbations grow into stop-and-go phantom jams, shown with speed-colored cars and a live space–time diagram.
Three.js Spiking Neural Network (Leaky Integrate-and-Fire)
3D spiking neural network in Three.js built from leaky integrate-and-fire neurons, with excitatory and inhibitory cells, distance-based wiring and action potentials traveling along axons at finite conduction speed.
Three.js Genetic Algorithm (Evolving Smart Rockets)
Watch a genetic algorithm evolve 3D rockets to fly through obstacles to a target in Three.js, using fitness-proportional selection, single-point crossover, mutation and elitism.
Three.js Conway's Game of Life 3D (Cellular Automata)
Cellular automata in Three.js — Conway's Game of Life stacked through time as a 3D sculpture, plus true 3D Life rules (Bays 4555, 5766, Clouds, crystal growth) over a 26-cell neighbourhood.
Three.js Reaction–Diffusion (Gray–Scott on the GPU)
GPU Gray–Scott reaction–diffusion in Three.js using ping-pong render targets, with coral, mitosis, maze and soliton presets, an F × k parameter map, paint-to-seed and a seamless torus display.
Three.js Diffusion-Limited Aggregation (Fractal Growth)
3D diffusion-limited aggregation in Three.js where random walkers stick to a growing cluster, producing frost-, coral- and lightning-like fractals from a point, a ground plane, a disc or a line seed.
Three.js N-Body Gravity Simulation (Galaxy Collision)
Direct-summation N-body gravity in Three.js with leapfrog integration and Plummer softening, covering colliding disk galaxies, a rotating disk, an equilibrium Plummer sphere and cold collapse, with live energy and virial diagnostics.
Three.js LIDAR Point Cloud Viewer (LAS, PLY, XYZ)
Point cloud viewer in Three.js with a synthetic airborne LIDAR scan and local LAS, PLY and XYZ loading, offering elevation, ASPRS classification, intensity and RGB coloring, class filters and height clipping on the GPU.
Three.js Vector Field Streamlines (Tornado, ABC Flow, Double Gyre)
General 3D vector-field tracer in Three.js with RK4 streamlines, flowing dash animation, arrow glyphs and advected particles, covering a Burgers vortex, chaotic ABC flow, point charges, the time-dependent double gyre and a linear saddle.
Three.js Heat Diffusion Simulation (Heat Equation PDE)
Heat equation simulation in Three.js with spatially varying conductivity across copper, steel, insulators and air, Dirichlet or insulated boundaries, isotherms, a 3D temperature relief and shift-drag painting.
Three.js Hydraulic Erosion Terrain Simulator
Particle-based hydraulic erosion in Three.js where hundreds of thousands of raindrops carve gullies and lay down sediment fans on a procedural heightmap, with thermal slumping and visible droplet paths.
Three.js Protein Molecular Surface (Marching Cubes)
Molecular surface of a synthetic folded protein in Three.js, built as a Gaussian density isosurface with MarchingCubes and colored by electrostatic potential or hydrophobicity from a 3D texture, with a rainbow backbone inside.
Medical Imaging
Explore 2 medical imaging examples and code samples.
Three.js CT Volume Rendering (DICOM-style Ray Marching)
GPU volume rendering of a 128³ chest CT in Three.js with WebGL2 3D textures, offering transfer-function compositing, maximum intensity projection and shaded isosurfaces, plus cut-away clipping. Uses a synthetic phantom, not patient data.
Three.js CT Slice Viewer (Axial, Coronal, Sagittal MPR)
Multi-planar reconstruction viewer in Three.js showing axial, coronal and sagittal CT slices in 3D and in three 2D panes, with radiology window/level presets, scroll-to-page, crosshairs and HU readout under the cursor.
Data Visualization
Explore 15 data visualization examples and code samples.
Interactive 3D Bar Chart in Three.js
Interactive Three.js 3D bar chart for dataset comparison with animated transitions, hover feedback, dynamic scaling, and orbitable camera controls for exploratory data visualization.
Interactive 3D Globe in Three.js
Interactive Three.js 3D globe visualization with geospatial location pins, latitude/longitude grid overlays, smooth auto-rotation, and configurable styling for geographic data storytelling and map-based dashboards.
Three.js Force-Directed Network Graph (3D)
An interactive force-directed network graph in Three.js, laying out hundreds of nodes from a community-structured random graph with Coulomb repulsion, spring links and cooling, sized by degree, coloured by community, with neighbour highlighting on hover.
Three.js 3D Stock Chart (Candlesticks, Volume & Moving Averages)
A live financial chart in Three.js, with instanced candlesticks, volume bars and 20/50-day moving averages for simulated tickers that stream new trading days, plus a comparison view of every ticker's return as stacked 3D ribbons.
Three.js Population Density Hex Map
A 3D hex-bin population map in Three.js over a procedural nation, where Zipf-sized coastal cities grow and sprawl from 1900 to 2025 as extruded hexagonal prisms coloured with viridis on a log or linear scale.
Three.js Weather Map (Wind Particles, Isobars & Pressure Systems)
A meteorological visualization in Three.js, with thousands of wind tracers streaming around drifting low- and high-pressure systems, isobars from marching squares, and switchable temperature or pressure shading.
Three.js Social Media Analytics (Streamgraph & Bubble Chart)
Engagement analytics in Three.js for 60 days of synthetic posts across five content channels, shown as an extruded 3D streamgraph or a log-scale bubble chart with reach as size and hover details.
Three.js Supply Chain Network Flow Visualization
A four-tier logistics network in Three.js (suppliers, factories, warehouses, stores) with flow-weighted 3D arcs, animated shipments, utilisation bars, and the ability to knock a node offline and watch flows re-route.
Three.js Tournament Bracket (Radial, Elo Simulation)
A 16-team single-elimination bracket in Three.js, laid out radially or classically, with matches simulated round by round from Elo win probabilities, the champion's path highlighted and title odds from 2,000 Monte-Carlo tournaments.
Three.js Family Tree (Genealogy Visualization)
A generated multi-generation family tree in Three.js with a tidy layout by subtree width, couples, married-in partners, and ancestor and descendant highlighting that cycles through family members.
Three.js 3D Timeline of History (Helix Fly-Through)
Six centuries of milestones in science, technology, exploration and politics on a 3D helix or straight rail in Three.js, with a compressed time scale, spans drawn as arcs and a fly-through camera.
Three.js 3D Treemap (Squarified, Drill-Down)
Hierarchical data as a 3D squarified treemap in Three.js, showing a synthetic code repository with area as file size, height as recent changes, colour by top-level folder, nesting depth control and click to drill down.
Three.js 3D Sankey Diagram (Energy Flow)
An extruded 3D Sankey diagram in Three.js tracing an illustrative energy system from primary sources through electricity and fuels to end-use sectors and useful energy versus losses, with flowing gradient ribbons and node tracing.
Three.js Scatter Plot Matrix (SPLOM) with Linked Brushing
A scatter-plot matrix in Three.js showing every pair of four features for three species, with histograms on the diagonal, linked brushing that highlights samples across all panels, and a rotating 3D scatter of any three features.
Three.js 3D Heat Map (Hour × Day Calendar)
A full year of hourly data as a 3D heat map in Three.js, with 8,760 cells as instanced bars or a displaced surface, perceptual colour maps, smoothing, and datasets showing daily, weekly and seasonal cycles.
Games & Interactive
Explore 18 games & interactive examples and code samples.
Pong 3D
Classic arcade game reimagined in 3D space with realistic physics, AI opponent, and interactive controls.
Marble Maze
Tilt the mahogany board to guide the silver marble through a challenging logic maze.
3D Tetris
Stacking blocks in three dimensions — a spatial reasoning puzzle in a glass container.
Breakout 3D
Smash a wall of colorful 3D bricks with a bouncing ball and a sliding paddle.
Snake 3D
Slither through a neon 3D grid, consuming energy cubes to grow while avoiding the walls and your own tail.
Pac-Man 3D
Navigate a 3D neon maze, collect pellets, and avoid the ghosts in this spatial reimagining of the classic.
Missile Command 3D
Defend the metropolis from a barrage of incoming ballistic missiles using interceptor rockets and tactical explosions.
Target Gallery
Test your reflexes in this 3D shooting gallery. Click on rapidly moving targets and clear the field before time runs out.
Stacking Challenge
How high can you go? Stack sliding blocks with pixel-perfect precision. Any overhang is sliced off!
3D Bowling
Realistic physics-based bowling. Aim your throw, add some spin, and try for a strike!
Space Invaders 3D
A voxel-based orbital shooter. Defend your sector from descending grids of alien invaders.
Minesweeper 3D
The classic logic puzzle, reimagined as a 3D block. Reveal all safe tiles without hitting a mine!
Tower Defense
Strategic defense game. Place automated turrets along a path to stop waves of incoming enemies.
Asteroids 3D
Classic space shooter in 3D. Pilot your ship through a field of drifting asteroids and clear the sector.
Rubik's Cube
A fully interactive and solvable 3D Rubik's Cube puzzle.
Chess 3D
A beautiful 3D chess board for interactive play. Grab and move pieces across the board.
Three.js Flight Simulator (Arcade Flight Model)
Fly a light aircraft over procedural mountains in Three.js with a simple 6-DoF flight model of thrust, lift from angle of attack, drag, stall and gravity, a chase camera, a ring course down a river valley and an autopilot.
Three.js Racing Game (Spline Track, AI Opponents)
A Three.js racing game on a closed Catmull-Rom circuit with kerbs and a start gantry, a grip-limited car handling model, pure-pursuit AI opponents that brake for corners, lap timing, and chase, cockpit and overhead cameras.
Ray Marching
Explore 3 ray marching examples and code samples.
Three.js Ray Marching SDF Shapes Gallery
Sphere-traced signed distance fields in a Three.js fullscreen shader, including a box↔sphere morph, torus, octahedron and smooth-union blobs, with soft shadows, ambient occlusion and a step-count heatmap.
Three.js Fractal Mountains (Ray-Marched Terrain)
Infinite procedural mountains ray-marched in a Three.js shader using derivative-damped fBm for eroded ridges, with snow, water, soft sun shadows, aerial perspective and an automatic fly-through.
Three.js Volumetric Clouds (Ray-Marched)
Real-time volumetric clouds in a Three.js shader with fBm density in a cloud slab, self-shadowing light marches, Beer–Lambert transmittance, a powder effect and dual-lobe Henyey–Greenstein scattering.
Advanced Shaders
Explore 12 advanced shaders examples and code samples.
Three.js Water Caustics Shader (Refraction Jacobian)
Physically motivated pool caustics in Three.js, where sunlight refracted through an animated water surface is focused into bright filaments on the floor, walls and objects, with optional chromatic dispersion.
Three.js Subsurface Scattering (Translucent Materials)
Real-time translucency in Three.js using a back-face depth pre-pass for screen-space thickness, so thin parts like fingers and knot loops glow when back-lit, with jade, skin, wax and marble presets.
Three.js Toon & Cel Shading (Outlines, Rim Light, Hatching)
Non-photorealistic rendering in Three.js comparing MeshToonMaterial gradient maps, a custom cel shader with rim light and hard specular, and screen-space cross-hatching, all with inverted-hull outlines.
Three.js Fur Shader (Shell Texturing)
Real-time fur in Three.js using shell texturing, where one instanced draw renders dozens of offset shells and each strand tapers, droops with gravity, sways in the wind and can be brushed with the pointer.
Three.js Ocean Water Shader (Gerstner Waves)
Open ocean in Three.js with summed Gerstner waves computed on the GPU, analytic normals, Fresnel sky reflection, sun glints, crest foam and fake subsurface light, plus a buoy that rides the same waves.
Three.js Volumetric Fire Shader
Ray-marched volumetric campfire in Three.js where domain-warped rising fBm defines the flame, temperature drives a blackbody color ramp, and sparks plus a flickering point light complete the scene.
Three.js Hologram Shader Effect
Sci-fi hologram shader in Three.js combining a Fresnel rim glow, scanlines, a sweeping scan band, flicker and vertex-slice glitches, displayed above a projector with a light cone.
Three.js Matrix Digital Rain Shader
Digital rain in Three.js with columns of mirrored katakana and digits from a canvas glyph atlas, each falling at its own speed with a bright leading glyph and fading trail, wrapped around the viewer.
Three.js Energy Shield / Force Field Shader
Sci-fi force field in Three.js with a hexagonal grid, Fresnel glow, impact ripples that travel over the sphere, and a soft glow where the shield intersects the ground and ship, using a scene depth pre-pass.
Three.js Portal Effect (Render-to-Texture Window)
A portal into another world in Three.js, where a second scene is rendered from the same camera into a render target and shown through a swirling, glowing disc with correct parallax and spiralling particles.
Three.js Liquid Metal Shader (Ray-Traced Metaballs)
T-1000-style liquid metal in Three.js, with smooth-union metaballs merging into a molten pool, ray-traced with Fresnel-Schlick reflections, two bounces and a studio environment, in mercury, gold, copper or chrome.
Three.js Procedural Animated Textures Gallery
Six fully procedural animated materials in Three.js (Voronoi cells, lava flow, marble, wood, plasma and electric arcs) evaluated per pixel in object space, with no image textures.
Tools & Interaction
Explore 10 tools & interaction examples and code samples.
Three.js glTF / GLB Model Viewer (Drag & Drop Inspector)
Drag-and-drop glTF/GLB viewer in Three.js with scene-graph, mesh, triangle, material and animation stats, wireframe, bounding-box and normals helpers, room-environment lighting, and an exported-then-reimported sample model.
Three.js Texture Compression Inspector (BC1 / KTX2 Formats)
GPU texture compression explained in Three.js with a real-time JavaScript BC1/DXT1 encoder, CompressedTexture upload with mipmaps, RGB565 and error-heatmap views, PSNR and memory stats, filtering modes and detection of the formats a KTX2 file would transcode to.
Three.js Sprite Sheet Animator (Flipbook Billboards)
Flipbook sprite animation in Three.js from a packed 8×3 sprite sheet (coin spin, explosion, walk cycle) on hundreds of instanced camera-facing billboards, with per-instance phase, frame blending and a live atlas preview.
Three.js Transform Gizmos (TransformControls with Snapping & Undo)
Interactive translate, rotate and scale gizmos in Three.js with TransformControls, including click selection, world/local space, configurable snapping, W/E/R/Q keyboard shortcuts, frame-selection and an undo stack.
Three.js Raycast Picking Modes (BVH vs Brute Force)
Compare raycast picking strategies in Three.js on a 480k-triangle mesh (three-mesh-bvh BVH acceleration, brute-force triangle tests and coarse bounding-box picks) with live timing, hit-triangle highlight and BVH visualization.
Three.js Measurement Tool (Distance, Angle, Area, Snapping)
Interactive 3D measuring in Three.js covering point-to-point distance, three-point angles, polygon area and height above the floor, with vertex and grid snapping, unit conversion and CSS2D labels in a furnished room.
Three.js 3D UI Panels (CSS3DRenderer & CSS2DRenderer)
HTML interfaces in Three.js scenes, with interactive world-locked CSS3D control panels whose buttons drive the WebGL scene, screen-aligned CSS2D name tags with occlusion fading, and a fixed DOM HUD for comparison.
Three.js Drag & Drop Scene Builder
Build a scene in Three.js by dragging assets from an HTML palette onto the ground, with a live ghost preview, grid snapping, drag-to-move, 45° rotation and delete shortcuts, shadows and placement stats.
Three.js Node-Based Material Editor (Shader Graph)
A working node-graph material editor in Three.js where you drag nodes, wire outputs to inputs and see the graph compiled to GLSL and applied live, with UV, position, noise, stripes, fresnel, math nodes and presets.
Three.js UV Layout Previewer & Distortion Heatmap
Inspect a mesh's UV layout in Three.js with a live 2D UV panel, a labelled checker texture, a per-triangle stretch heatmap and planar, cylindrical and spherical projections, plus hover highlighting linked between mesh and UV space.
AI & Machine Learning
Explore 10 ai & machine learning examples and code samples.
Three.js Neural Network Training Visualization (Backprop in 3D)
Watch a small neural network learn in real time in Three.js, as a 2-8-8-1 multilayer perceptron trains with backpropagation on spiral, XOR, circle or moons data, with a live 3D decision surface and neurons and weights coloured by activation and sign.
Three.js Pathfinding Visualizer (A*, Dijkstra, Greedy, BFS)
Compare A*, Dijkstra, greedy best-first and breadth-first search on a 3D grid in Three.js, animating the open set, explored cells coloured by cost and the final path over random walls, recursive mazes or weighted terrain, with click-to-edit walls.
Three.js Boids Flocking Simulation (Separation, Alignment, Cohesion)
Reynolds boids in Three.js, with thousands of instanced birds steering by separation, alignment and cohesion using a spatial hash, avoiding obstacles and scattering from a hunting predator.
Three.js Decision Tree Classifier (CART Visualization)
Grow a CART decision tree in Three.js on rings, blobs or checkerboard data, watching the axis-aligned decision regions refine as depth increases next to a live diagram of the learned splits, leaf classes and training accuracy.
Three.js Clustering Algorithms (K-means vs DBSCAN in 3D)
Animated unsupervised clustering in Three.js, comparing K-means with k-means++ seeding (assign and update steps converging) against density-based DBSCAN growing clusters and flagging noise on 3D blobs, rings and moons.
Three.js Genetic Programming (Symbolic Regression)
Evolve mathematical programs in Three.js, where a population of expression trees uses tournament selection, subtree crossover and mutation to rediscover a target function from data, shown with the best program's curve and a live tree diagram.
Three.js Reinforcement Learning (Q-Learning vs SARSA Gridworld)
Tabular reinforcement learning in Three.js, where an agent learns to reach the goal in cliff-walk, four-rooms and maze gridworlds with Q-learning or SARSA, shown as live value heights, greedy-policy arrows and the latest episode path.
Three.js Computer Vision Object Detection Overlay
A real-time detection pipeline on a Three.js scene, where frames from an offscreen render-target "sensor" are read back, colour-segmented in HSV and grouped with union-find connected components into labelled bounding boxes drawn as an overlay.
Three.js Word Embeddings & Attention (NLP Visualization)
Explore a 21-dimensional word-embedding space in Three.js, projected to 3D with PCA, solving analogies such as king − man + woman ≈ queen with arrows, and showing scaled dot-product self-attention between the words of a sentence.
Three.js Recommendation Engine (Collaborative Filtering)
Collaborative filtering with matrix factorisation in Three.js, as SGD learns user and item vectors from a sparse ratings matrix, plotted live in a 3D latent space with predicted ratings filling the matrix and top-5 recommendations for each user.
Architecture & Environments
Explore 12 architecture & environments examples and code samples.
Three.js Procedural City Generator (Day/Night Skyline)
A procedural city in Three.js, with recursive lot subdivision on a street grid, a downtown skyline peak, a single-draw instanced facade shader with lit windows at night, a full day/night cycle, street lamps and traffic.
Three.js Gothic Cathedral Interior (Procedural Architecture)
Walk a procedurally built Gothic cathedral in Three.js, with lancet arcades, clustered piers, clerestory, ribbed quadripartite vaults, stained-glass lancets, two rose windows and sunlight shafts, from merged geometry with soft shadows.
Three.js Modern House Walkthrough (Interior Architecture)
An architectural walkthrough of a furnished modern house in Three.js, with open-plan living, kitchen, dining, bedroom and bath, floor-to-ceiling glazing with transmission, a pool deck, soft shadows, RoomEnvironment reflections and an automatic camera tour.
Three.js Ancient Ruins (Weathered Stone Temple)
A procedurally weathered Greek-style temple in Three.js, with fluted column drums eroded by 3D noise, broken and fallen columns, gapped cella walls, rubble, creeping overgrowth and golden-hour light with exponential fog.
Three.js Space Station (Rotating Habitat Ring)
An orbital station in Three.js above a procedural planet, with a spinning habitat ring that computes its artificial gravity, sun-tracking solar wings, radiators, blinking navigation lights and shuttles docking at the forward port.
Three.js Underground Cave System (Noise-Carved Tunnel)
Explore a noise-carved cave in Three.js by headlamp, with a winding tunnel swept along a spline and displaced by 3D fbm, two large chambers, stalactites and stalagmites, glowing crystal clusters with point lights, and an underground pool.
Three.js Dense Forest Environment (Instanced Trees & Wind)
A dense procedural forest in Three.js, with thousands of instanced conifers and broadleaf trees placed by jittered grid and density noise, around 20,000 undergrowth cards, wind sway injected into standard materials, soft shadows, mist and fireflies at dusk.
Three.js Desert Oasis (Dunes, Palms & Sky)
A desert oasis in Three.js, with ridged-noise sand dunes around a basin, a reflective pool showing a CubeCamera capture of the physically based Sky, palms with Bézier tube trunks and swaying fronds, a mud-brick well house and tents.
Three.js Cyberpunk Neon Street (Rain & Bloom)
A rain-soaked cyberpunk alley in Three.js, with canvas-texture neon signs (some flickering), lit windows, overhead cables, wet asphalt reflecting a CubeCamera capture, 6,000 rain streaks, flying cars and UnrealBloom glow as the camera walks the street.
Three.js Underwater Scene (Caustics, Kelp & Fish)
An ocean floor in Three.js with animated caustics injected into standard materials, a coral reef of instanced forms, a 700-ribbon kelp forest bending in the current, schooling fish, marine snow, light shafts and murky blue fog.
Three.js Mountain Vista (Terrain LOD with THREE.LOD)
A 3.6 km mountain landscape in Three.js built from 81 terrain chunks, each a THREE.LOD with four resolutions, using ridged multifractal noise with domain warping, slope- and height-based snow and rock, a physical sky and fog, with live triangle counts.
Three.js Airport Terminal (Large Interior Space)
A large-span airport terminal in Three.js with a wave roof on branching steel columns, a glass airside facade, gate seating, a live departures board drawn to a canvas texture, an instanced crowd, parked and taxiing aircraft, and a camera tour.
Virtual Reality
Explore 4 virtual reality examples and code samples.
Three.js WebXR Hand Tracking (Gesture Recognition)
WebXR hand tracking with gesture recognition in Three.js, classifying open palm, fist, point, peace, thumbs up, rock and pinch from 25-joint hand skeletons measured live, using real XRHand joints in VR or an animated procedural hand on desktop.
Three.js WebXR VR Headset Preview (Stereo & Lens Distortion)
A WebXR VR session demo in Three.js that detects immersive-vr, immersive-ar and inline support, enters VR on supported headsets, and previews stereo rendering on desktop with adjustable IPD, barrel lens distortion and chromatic aberration.
Three.js VR Teleportation (Parabolic Arc Locomotion)
Comfortable VR locomotion in Three.js with a parabolic teleport arc ray-tested segment by segment, target validation by surface slope and blocked areas, blink fade, snap turning and rig-relative movement, using XR controllers or the mouse on desktop.
Three.js Virtual Art Gallery (WebXR Exhibition)
Walk a virtual art gallery in Three.js or in VR, with ten seeded generative canvases (flow fields, circle packing, Truchet tiles, phyllotaxis, Voronoi and more) in frames under picture spotlights, sculptures on plinths, museum labels and a guided tour.
Augmented Reality
Explore 4 augmented reality examples and code samples.
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.
WebXR Advanced
Explore 8 webxr advanced examples and code samples.
Three.js WebXR Hit Test & Anchors (AR Placement)
Place virtual objects on real surfaces with WebXR in Three.js, using a hit-test source for the reticle and anchors that stay locked to the world, with a desktop simulation that raycasts a room and adds tracking drift to show why anchors matter.
Three.js WebXR Hand Physics (Grab, Throw, Poke)
Natural hand interactions in Three.js, where you pinch to grab objects, release to throw with the measured hand velocity and poke physical buttons with your fingertip, using a small impulse-based sphere physics engine, real XR hands in VR or a mouse-driven hand on desktop.
Three.js AR Depth Occlusion (Passthrough Depth Sensing)
Depth-based occlusion for passthrough AR in Three.js, where a virtual robot walks behind real furniture as every virtual fragment is tested against a real-world depth map, with soft edges, adjustable depth resolution and noise to show real-sensor artefacts.
Three.js WebXR Controllers (Input Profiles & Haptics)
XR controller input in Three.js with procedural models whose trigger, grip, thumbstick and face buttons move with the xr-standard gamepad mapping, haptic pulses on trigger press, and input from real XR controllers, any connected gamepad, the keyboard or an auto demo.
Three.js VR Locomotion & Comfort (Vignette, Snap Turn)
Comfortable smooth locomotion for VR in Three.js, with head- or body-directed movement, snap or smooth turning, ramped acceleration and a dynamic comfort vignette that narrows the field of view with linear and angular speed, working with thumbsticks or the keyboard.
Three.js Mixed Reality Compositor (Chroma Key & Camera Feed)
A mixed-reality video compositor in Three.js, with YCbCr chroma keying, spill suppression and a key matte view for green-screen actors in a virtual set, or virtual objects over a camera plate, colour-matched for exposure, white balance and grain, using a synthetic camera or your webcam.
Three.js XR UI Panels (World-Locked, Lazy-Follow, Head-Locked)
Spatial UI for XR in Three.js, with canvas-drawn buttons, toggles and sliders on 3D panels hit-tested in UV space, and three placement strategies, world-locked, lazy-follow and head-locked, driven by a mouse pointer or an XR controller ray.
Three.js Shared Anchors (Multi-Device AR Alignment)
The idea behind shared or cloud anchors for multi-user AR in Three.js, where two devices track the same room in different local frames, a jointly observed anchor yields T_B←A = anchor_B · anchor_A⁻¹, and content placed by one appears correctly for the other despite drift and noise.