Skip to content
Tutorials Center
My learning

Topics

Three.js Tutorial

Learn Three.js step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Three.js? Learn what Three.js is, how it sits on top of WebGL, what a scene, camera and renderer do, and spin your first 3D cube in the browser.
  2. 2 Setting Up a Three.js Project Set up Three.js three ways: an import map with no build step, npm with Vite, and a handy responsive template with OrbitControls and resize handling.
  3. 3 Coordinates, Position, Rotation and Scale Understand the Three.js right-handed coordinate system and learn to position, rotate and scale objects with Vector3, Euler angles and helpers.
  4. 4 The Render Loop and Timing Build a correct Three.js animation loop with setAnimationLoop, delta time and Clock so motion runs at the same speed on every screen, with pausing tips.
  5. 5 Helpers and Debugging Tools Debug Three.js scenes with built-in helpers, lil-gui sliders and a stats panel, and learn the usual reasons for a blank screen or a black object.

Scene, Camera and Renderer

  1. 6 The Scene Graph and Object3D Learn how Three.js organizes objects in a tree with Scene, Group and Object3D, how parents transform children, and how to traverse, find and remove objects.
  2. 7 PerspectiveCamera: Field of View and Frustum Master the Three.js PerspectiveCamera: field of view, aspect ratio, near and far planes, lookAt and the viewing frustum, with a live frustum visualizer.
  3. 8 Orthographic, Multiple and Special Cameras Use the Three.js OrthographicCamera for 2D and isometric views, render several viewports from different cameras, and meet CubeCamera, ArrayCamera and StereoCamera.
  4. 9 WebGLRenderer in Depth Configure the Three.js WebGLRenderer: antialiasing, alpha, pixel ratio, color space, tone mapping, clear color, render targets and context loss handling.
  5. 10 Vectors, Matrices and Quaternions Learn the Three.js math classes: Vector3 operations, dot and cross products, Matrix4 transforms, quaternions and slerp, plus MathUtils helpers with live demos.

Geometry and Materials

  1. 11 Built-in Geometries Tour every common Three.js geometry: box, sphere, plane, cylinder, torus, capsule and polyhedra, plus Lathe, Extrude, Shape and Tube. Includes live examples.
  2. 12 Custom Shapes with BufferGeometry Build your own Three.js geometry with BufferGeometry and BufferAttribute: positions, indices, normals, vertex colors and UVs, plus procedural terrain and waves.
  3. 13 Materials: Basic, Lambert, Phong, Toon and Utility Compare Three.js materials: MeshBasic, Lambert, Phong, Toon, Normal, Depth and Matcap. Learn color, opacity, side, wireframe and when to pick each one.
  4. 14 PBR Materials: Standard and Physical Learn physically based rendering in Three.js: roughness, metalness, clearcoat, transmission, sheen, iridescence and environment maps with an interactive material lab.
  5. 15 Lines, Points and Sprites Draw lines, dashed curves, outlines, point clouds and camera-facing sprites in Three.js, and build a star field and a canvas-text label with live examples.

Lights and Shadows

  1. 16 Light Types in Three.js Learn every Three.js light: AmbientLight, HemisphereLight, DirectionalLight, PointLight, SpotLight and RectAreaLight, with intensity, decay, cone settings and helpers.
  2. 17 Shadows in Three.js Enable realistic Three.js shadows: renderer shadow maps, castShadow and receiveShadow, shadow camera bounds, map size, bias to fix acne, and soft shadow types.
  3. 18 Environment Lighting, HDR and Skies Light Three.js scenes with environment maps: PMREMGenerator, RoomEnvironment, HDR images, the procedural Sky add-on, background blur and environment intensity.
  4. 19 Lighting Recipes and Practice Apply Three.js lighting in practice: three-point studio lighting, a day-night cycle with a moving sun, indoor lamps, baked light and a checklist plus practice tasks.

Textures and Loading Models

  1. 20 Textures and UV Mapping in Three.js Learn how Three.js textures work: TextureLoader, CanvasTexture, UV coordinates, wrapping, repeat, filtering, color spaces and scrolling textures, with live examples.
  2. 21 Environment Maps and PBR Texture Maps Make Three.js materials look real: image-based lighting with PMREMGenerator and RoomEnvironment, roughness, metalness, normal and bump maps, and CubeCamera reflections.
  3. 22 Loading glTF Models in Three.js Load 3D models in Three.js with GLTFLoader: glTF vs GLB, scene graph traversal, centering and scaling, Draco and KTX2 compression, and exporting your own glTF.
  4. 23 OBJ, STL, FBX and the LoadingManager Load OBJ, STL, PLY and FBX files in Three.js, export OBJ and STL, and build progress bars with LoadingManager, caching and custom loaders. Runnable examples.

Animation and Interaction

  1. 24 The Three.js Animation Loop and Timing Animate Three.js scenes with setAnimationLoop, Clock and Timer, delta time, frame-rate independence, lerp, damping and easing functions, with runnable examples.
  2. 25 Keyframe Animation and AnimationMixer in Three.js Animate with keyframes in Three.js: KeyframeTrack, AnimationClip, AnimationMixer, AnimationAction, looping, crossfading, events and a skinned bone chain, with live examples.
  3. 26 Raycasting and Picking Objects in Three.js Pick 3D objects with the mouse in Three.js using Raycaster: normalized device coordinates, hover and click, intersection data, layers, dragging on a plane and line of sight.
  4. 27 OrbitControls, TransformControls and Camera Rigs Let users explore a Three.js scene with OrbitControls, move objects with TransformControls, choose between other controls, and build a smooth follow-camera rig by hand.

Shaders and Post-processing

  1. 28 Shader Material Basics: GLSL in Three.js Write your first Three.js shaders: vertex and fragment stages, uniforms, varyings, built-in attributes, ShaderMaterial, animated patterns and a toon shader, with live examples.
  2. 29 Vertex Shaders, Displacement and onBeforeCompile Move vertices on the GPU in Three.js: wave and noise displacement, custom attributes, shader-driven particles with Points, and extending MeshStandardMaterial with onBeforeCompile.
  3. 30 Post-processing in Three.js with EffectComposer Add bloom, outlines, vignettes and custom full-screen effects to Three.js with EffectComposer, RenderPass, UnrealBloomPass, OutputPass and your own ShaderPass.
  4. 31 Render Targets, Minimaps and GPU Computation Render to textures with WebGLRenderTarget in Three.js: TV screens, minimaps with scissor viewports, read pixels back, and ping-pong GPU simulations like the Game of Life.

Performance and Frameworks

  1. 32 Three.js Performance Fundamentals Make Three.js scenes fast: read renderer.info, cut draw calls, share geometry and materials, dispose GPU memory, limit pixel ratio and render on demand, with measurable examples.
  2. 33 Instancing, Merging, BatchedMesh and LOD Draw thousands of objects fast in Three.js: InstancedMesh with per-instance color and matrices, merged geometry, BatchedMesh for mixed shapes, and LOD for distance-based detail.
  3. 34 React Three Fiber, TresJS and Other Frameworks Use Three.js with React Three Fiber, drei, Threlte and TresJS: how declarative scenes work, hooks like useFrame, and a runnable mini-reconciler that shows the idea behind them.
  4. 35 WebGPU, TSL and Three.js Build Tools Try WebGPURenderer and Three Shading Language (TSL) in Three.js, check capabilities, then ship real projects with npm, Vite, tree shaking, code splitting and TypeScript types.

Projects and Practice

  1. 36 Project: Build an Interactive Solar System Build a Three.js solar system step by step: orbit pivots, procedural planet textures, rings, moons, a starfield, OrbitControls, hover labels and click-to-focus camera.
  2. 37 Project: A 3D Product Configurator Build a 3D product configurator in Three.js: parametric chair model, material swapping, view presets, exploded view, soft shadows, price calculation, saved config and a screenshot button.
  3. 38 Project: A Procedural Particle Galaxy Generate a spiral galaxy with 100,000 GPU particles in Three.js: parametric arms, color gradients, a custom point shader, live sliders that rebuild geometry, and proper disposal.
  4. 39 Three.js Practice Challenges and Debugging Checklist Test your Three.js skills with graded challenges, a reusable scene diagnostic helper for black screens and missing objects, a physics bounce solution, a mini-game and a learning roadmap.