Three.js examples & lessons
Learn one 3D concept at a time. Read the scene, run it, and change something you can see. Each lesson includes editable code, an explanation, and a concrete challenge.
Your first five scenes
From one mesh to a scene with hierarchy, camera controls, and real shadows.
15 of 15 lessons
Foundations
Rotating Cube
Build your first mesh and animate its rotation with elapsed time.
Open lessonFoundations
Position, Rotation & Scale
Compare three meshes that share geometry but use different local transforms.
Open lessonFoundations
Solar System
Use nested groups to separate a planet's orbit from a moon's local orbit.
Open lessonFoundations
Perspective & Orbit Controls
Frame a subject and constrain orbit controls without moving the scene.
Open lessonLight & surfaces
Lighting & Real Shadows
Connect a shadow-casting light, a casting mesh, and a receiving floor.
Open lessonLight & surfaces
Material Gallery
Isolate roughness and metalness using identical spheres under identical lighting.
Open lessonLight & surfaces
Textures & Color Space
Paint a local canvas texture and label its colors correctly for rendering.
Open lessonLight & surfaces
Procedural Environment
Light a reflective object with six generated cube-map faces instead of an external HDR image.
Open lessonAnimation & interaction
Frame-Rate Independent Motion
Move an object in units per second, not units per frame.
Open lessonAnimation & interaction
Raycast Picking
Turn a pointer position into a camera ray and identify the nearest mesh.
Open lessonAssets & scale
Load a Local glTF Model
Load a real project asset with GLTFLoader and organize module code across files.
Open lessonAssets & scale
Instanced Mesh Grid
Draw hundreds of repeated objects with one geometry and one material.
Open lessonAssets & scale
Particle Field
Store many colored particles in BufferGeometry instead of creating a mesh per particle.
Open lessonShaders & effects
Write a Wave Shader
Displace vertices on the GPU and pass a height value to a fragment shader.
Open lessonShaders & effects
Postprocessing with Bloom
Render a scene through an effect pipeline and resize its offscreen targets with the viewport.
Open lessonAll starter assets are generated or included locally. Rendering needs a browser with WebGL 2; particle counts, shadows, and effects can cost more on mobile GPUs.