Three.js is a JavaScript library that makes 3D graphics in the browser practical without writing raw WebGL. Every project starts with the same trio: a scene that holds objects, a camera such as PerspectiveCamera, and a renderer that draws the scene into a canvas each frame. Objects are meshes, a geometry paired with a material, lit by lights you place yourself. From there you load glTF models, add textures, animate, pick objects with a Raycaster and eventually write custom shaders. It powers product viewers, data art and browser games. Learnr builds a personalized Three.js course that teaches it in short, interactive lessons.
How to learn Three.js, step by step
- Be comfortable with modern JavaScript. You need ES modules, classes and a bundler or dev server such as Vite. Install three from npm and import addons like OrbitControls from the examples folder, which is where many essential helpers live.
- Render a spinning cube from scratch. Create a scene, a PerspectiveCamera and a WebGLRenderer, add a BoxGeometry with a MeshStandardMaterial, and rotate it inside renderer.setAnimationLoop. Typing this by hand once teaches the structure of every Three.js app.
- Learn transforms and the coordinate system. Move, rotate and scale objects through position, rotation and scale, with y pointing up. Group objects so children move with parents, and add AxesHelper and GridHelper to see where things really are.
- Light, texture and load real models. A standard material looks black without light, so add ambient and directional lights and enable shadows. Then load a glTF file with GLTFLoader and apply textures, checking color space settings when colors look washed out.
- Add interaction and watch performance. Use a Raycaster to detect clicks on objects and update the camera and renderer on window resize. Reuse geometries and materials, dispose of what you remove, and keep draw calls low so phones stay smooth.
- Go deeper with shaders and a project. Write a ShaderMaterial with simple vertex and fragment shaders, then build a portfolio scene or product viewer. Short Learnr lessons on vectors and matrices make the math behind cameras and shaders far less scary.
What you'll learn
- Set up a scene, camera, renderer and animation loop
- Create meshes from geometries and choose fitting materials
- Light a scene and add shadows that look right
- Load glTF models and textures and control them with OrbitControls
- Make scenes interactive with a Raycaster and responsive to resizing
How long does it take to learn Three.js?
With solid JavaScript, you can build a simple interactive scene in 2 to 3 weeks at 5 hours a week. Lighting, models, performance and custom shaders typically take 3 to 6 months. Prior 3D experience in Blender or a game engine speeds this up.
What you need before you start
Good JavaScript and basic HTML and CSS. High school geometry and some comfort with vectors help a lot, and a little Blender knowledge makes preparing models easier.
Common mistakes to avoid
- Using a lit material with no lights and assuming the code is broken. Add lights or use MeshBasicMaterial while you debug.
- Forgetting to update the camera aspect and call updateProjectionMatrix on resize, which leaves the scene stretched on phones and resized windows.
- Creating new geometries and materials every frame, which slows rendering and leaks memory. Create once, reuse them, and dispose when removing objects.
How Learnr builds your course
Type your topic
Tell Learnr you want to learn Three.js, or get as specific as you like.
Get a personalized course
Learnr instantly builds a full Three.js course tailored to your goal and skill level.
Learn and level up
Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.
Three.js questions, answered
Do I need to learn WebGL before Three.js?
No. Three.js hides most of WebGL. Learning how shaders work later helps with custom effects, but you can build a lot without touching raw WebGL.
Can I use Three.js with React?
Yes. React Three Fiber is a popular library that lets you describe Three.js scenes as React components. Learning plain Three.js first makes it much easier to understand.
Is Three.js good for making games?
It works well for browser games and experiences, though it is a rendering library rather than a full engine. You add physics, audio and game logic with other libraries or your own code.
Explore more courses
More programming and tech courses
- Learn WebAssembly
- Learn Solidity
- Learn Blockchain
- Learn Perl
- Learn Objective-C
- Learn Julia
- Learn Zig
- Learn Clojure
See all programming and tech courses
Ready to learn Three.js?
Start your free, personalized Three.js course in seconds. It will be typed in and ready when you get there.
Start learning Three.jsFree to start. No credit card.