egghead
Learn
Courses
Lessons
Articles
⌘K
Account
Browse
Search
Find courses, lessons, articles, talks, and podcasts.
Search
All types
Instructor
Loading resources.
Search | egghead
egghead
Learn
Courses
Lessons
Articles
⌘K
Sign in
Search
All types
Instructor
24 resources
campaign
Legacy Campaign Archive
lesson
Organize your Three.js Project - Part 3
Extract the Three.js camera into a factory function that subscribes to a shared resize observer and returns a dispose method.
lesson
Organize your Three.js Project - Part 2
Extract the Three.js renderer into its own factory function that accepts a canvas and resize observer, returning a dispose method for proper cleanup.
lesson
Organize your Three.js Project - Part I
Refactor a messy Three.js main.ts into scalable, maintainable code using factory composition.
lesson
Debug with Tweakpane
Integrate Tweakpane to create a live debug panel for scene parameters. Add controls for object position, rotation, and material color that update in real time without touching the code.
lesson
Resize scene along with browser window
Listen for window resize events to update the camera aspect ratio and renderer size. Prevent the scene from stretching or distorting when the browser window changes dimensions.
lesson
Animations
Create a render loop using requestAnimationFrame and Three.js's Clock to animate objects smoothly. Use delta and elapsed time values to keep animations frame-rate independent.
lesson
Rotating objects
Use the rotation property to rotate objects around the X, Y, and Z axes. Learn why Three.js uses radians instead of degrees, how to convert between them using Math.PI, and how rotation direction is determined by sign.
lesson
Scaling objects
Use the scale property to resize objects along each axis independently. Learn that scale values are multipliers on the geometry's original dimensions, and use MeshNormalMaterial to better visualize face changes while experimenting.
lesson
Transform objects position
Move objects along the X, Y, and Z axes using the position property. Add an AxesHelper to stay oriented in 3D space, use position.set() to avoid verbose code, and learn what a Vector3 actually is with a visual explanation.
lesson
Camera and Renderer
Set up a PerspectiveCamera by understanding FOV and aspect ratio, initialize a WebGLRenderer tied to a canvas element, and fix the most common beginner mistake: camera and object starting at the same position.
lesson
Add objects to the scene
Create a Mesh by combining a BoxGeometry with a MeshBasicMaterial, add it to the scene, and render it.
lesson
Install three.js and @types/three
Install the three package and @types/three for full TypeScript support. Import Three.js into the project and confirm the types are working.
lesson
Elements of a 3D scene
Walk through the core building blocks of every Three.js scene. Every 3D scene out there is composed of the same main elements:
lesson
Create a new Vite Project
Scaffold a new project using pnpm create vite, select the Vanilla TypeScript template, and verify the dev server runs correctly.
course
Modern Three.js Course
Build production-ready 3D experiences on the web with Three.js, TypeScript, and Vite. This workshop takes you from an empty project to a modular, maintainable Three.js application using the same architectural patterns you'd reach for on a real product team.
lesson
Push a New Branch to github that Doesn't Exist Remotely Yet
We'll make a new feature branch with:
lesson
Cleanup and Delete Branches After a Pull Request
We've made a pull request and now we can clean up the branches by deleting the feature branch.
lesson
Add a File to a Previous Commit with Interactive Rebase
We're going to pick a previous commit and enter an interactive rebase with:
lesson
Move a Commit that was Committed on the Wrong Branch
We'll do some work and commit it - but then realize it was on the wrong branch!
lesson
Change the Commit Message of a Previous Commit with Interactive Rebase
We'll go back into our history with
lesson
Explore Old Commits with a Detached HEAD, and then Recover
To poke around in old code, we can checkout the hash of an old commit with git checkout [HASH] - but then we'll be in a "detached HEAD" state.
lesson
Remove Files from Staging Before Committing
If you've added files to the staging area (the Index) accidentally - you can remove them using git reset.
lesson
Remove Changes from a Commit Before Pushing
If we've already committed changes that we don't want to push, we can also remove those with git reset, but we're going to reset back to a specific commit, either with: