Threejs Guide
Threejs Guide
ThreeJS
CheatSheet
Created by JS Mastery
Three.js Course
After carefully considering your passion for
developing 3D applications from scratch and
diving into every aspect of it, we're excited to let
you know that your dream of learning and building
such apps is within reach.
We're working on a PRO course that will teach you:
Understanding the inner workings of 3D
Development
Mastering Three.js fundamentals with a focus on
every detail
Creating pixel-perfect 3D UIs for both Web and
Mobile applications
Developing apps with React Three Fiber and
React Three Drei
https://jsmastery.pro JavaScript Mastery
The Ultimate
Three.js Course
Exploring animations with GSAP with best practices
Working with Blender for 3D modeling & much
more
If this sounds like what you're looking for, join us
quickly to stay updated on course details and
suggest any features you’d like to see (we value
your input).
You can reply to the email from which you
received this guide, or drop your suggestion in the
| suggestions
Plus, you’ll have the opportunity to receive a
special discount just for you!
https://jsmastery.pro JavaScript Mastery
What’s in the guide?
Welcome to our Three.js cheat sheet! This guide
provides a quick reference to the fundamental
concepts and techniques used in Three.js, a powerful
JavaScript library for creating 3D graphics and
animations in the browser.
Whether you're a beginner or an experienced dev, this
cheat sheet is designed to help you quickly find and
use the most commonly used Three.js features.
In this cheat sheet, you'll find code snippets and
examples for setting up a scene, creating and
manipulating 3D objects, adding lighting and
materials, using cameras, and more.
So, whether you're building a 3D game, a data
visualization, or just experimenting with Three.js, this
cheat sheet is a valuable resource to have. Let’s start...
help on
// With your watching your
projects and able to land a
s
videos I wa t job at a
$110k/yr Reacn Diego, CA!
company in Sa
― Jake Simon ia
t Tragic Me
d
Developer a
Full Stack
to JSM Pro
<header>
Say
hero”>
<section id=”
ar t Le ar ning </h1>
<h1> St
<h2>
-->
<!-- React.js
-->
<!-- Next.js
ent
Web Developm
rters
<!-- Blockcha
in --> 500k+ suppo
-->
<!-- Solidity
</h2>
Now </h1>
<h1> Right
image to a canvas.
Renderer
Geometry
object in Three.js.
Light
Camera
Material
Scene
Texture
Animation
the scene.
involve billions.
single pixel.
surface details.
Cross-Platform Compatibility
consistent identity
Customizable Avatars
Free to Use
everyone.
Direct Integrations
For apps that support Ready Player Me, you can
directly link your avatar without needing to
download or convert files.
Ready-to-Use Animations
Mixamo offers a vast collection of pre-made
animations that can be applied to any 3D
character, saving time and effort
Ease of Use
No prior animation experience is needed. Mixamo's
intuitive interface allows you to quickly upload, rig,
and animate characters.
Customizability
You can fine-tune animations to fit your
character's needs by adjusting speed, arm
spacing, and loop settings
Free to Use
Mixamo is available to anyone with an Adobe
account, and there are no additional costs for
downloading animations or using the service.
Visit Mixamo
Go to the Mixamo website and log in
Click “Download”
Choose your preferred settings, such as format
(FBX)
applications or 2D games.
3D scenes.
Basic Geometries
THREE.SphereGeometry, THREE.CylinderGeometry,
BoxGeometry
SphereGeometry
CylinderGeometry
PlaneGeometry
TorusGeometry
Custom Geometries
built-in geometries.
MeshBasicMaterial
MeshPhongMaterial
metals or plastics.
MeshStandardMaterial
model of a product.
The model may have multiple parts, each with its own
Familiar syntax:
React Three Fiber uses a syntax that is similar to that
of React, which makes it easier for developers who are
familiar with React to learn and use Three.js.
Component-based architecture:
It uses React's component-based architecture, which
can make it easier to organize and manage the state
and lifecycle of 3D objects in a scene.
Debugging tools:
It provides debugging tools such as a helpful error
message and a built-in inspector, which can make it
easier to identify and fix issues in the 3D scene.
TypeScript support:
React Three Fiber has excellent TypeScript support,
which means that you can write type-safe Three.js
code in React.
Drei library:
Drei is a collection of useful Three.js components and
helpers that are built on top of React Three Fiber. Drei
components make it easy to create things like 3D text,
post-processing effects, and particle systems.
<mesh>
A component that wraps a 3D object and its material.
<primitive>
A component that creates a Three.js primitive
geometry, like a box or sphere.
<group>
A component that allows you to group objects
together for easier manipulation.
useFrame()
A hook that runs on every frame of the animation loop,
allowing you to update Three.js objects over time.
useGraph()
Convenience hook which creates a memoized, named
object/material collection from any Object 3D.
<perspectiveCamera>
A component that defines a perspective camera for
your scene.
intuitive interface.
OrbitControls component:
useTexture hook:
material.
Html component:
Component-based architecture:
Drei uses React's component-based architecture,
which makes it easier to organize and manage the
state and lifecycle of 3D objects in a scene.
Performance optimizations:
React Three Drei includes performance optimizations
such as automatic batching of meshes and pre-
loading of assets, which can help improve the overall
performance of a 3D application.
Code reusability:
React Three Drei over pure Three.js is that it can help
reduce code complexity & increase code reusability.
<OrbitControls>
A pre-built camera controller that allows users to pan,
zoom, and orbit around the 3D scene
<Html>
A component that allows you to render HTML elements
in a Three.js scene.
<Text>
A component that allows you to render 3D text in a
Three.js scene.
<Line>
A component that creates a 3D line mesh.
<Sphere>
A component that creates a 3D sphere mesh.
<Plane>
A component that creates a 3D plane mesh.
useTexture
A hook that loads a texture and returns a Three.js
texture object.
useGLTF
A hook that loads a GLTF model and returns a Three.js
object.
RTD Cheat Sheet
These are just a few examples of the many
components and hooks available in React Three Drei.
3D Text:
Create 3D text using Three.js and experiment with
different fonts, sizes, and colors to make it visually
interesting.
Particle Effects:
Create particle effects using Three.js and experiment
with different settings to make visually appealing
effects, such as explosions, fire, or rain.
3D Terrain:
Create a 3D terrain using Three.js and experiment with
different textures, heights, and shapes to create a
dynamic landscape.
3D Card Flip:
Create a simple card-flipping animation using
Three.js to showcase your understanding of basic 3D
transformations and animations.
3D Interactive Dice:
Build a 3D dice that users can roll and interact with
using Three.js, using basic geometry and materials to
create a realistic effect.
Animation
over time.
Physics
Textures
Optimization
devices.
Interactive 3D Gallery
upon clicking.
3D Data Visualization
Particle Effects
Experiment with particle systems in Three.js to create
mesmerizing effects like fire, smoke, water, or dynamic
particle-based animations.
Educational Simulations
Develop interactive educational simulations for
subjects like physics, chemistry, or biology. For eg, you
could create a simulation demonstrating gravitational
forces or molecular structures.
Interactive Storytelling
Combine 3D graphics with storytelling elements to
create immersive interactive narratives. Users can
navigate through the story world, interact with
characters, & make choices that affect the outcome.
Educational Simulations
Develop interactive educational simulations for
subjects like physics, chemistry, or biology. For eg, you
could create a simulation demonstrating gravitational
forces or molecular structures.
Sketchfab
https://sketchfab.com/
Poly Pizza
https://poly.pizza/
PMNDRS Market
https://market.pmnd.rs/
Filer
https://www.filer.dev/3d-models/1
Clara
https://clara.io/library
Pikbest
pikbest.com/decors-models/3d-models
CG Trader
https://www.cgtrader.com/3d-models/
Grabcad
https://grabcad.com/library
Autodesk Community
https://autodesk.com/community/gallery
Freepik
https://www.freepik.com/3d-models
RenderCrate
https://rendercrate.com/
Free 3D
https://free3d.com/
3dsky
https://3dsky.org/3dmodels
Thingiverse
https://www.thingiverse.com/
Cults
https://cults3d.com/
Turbosquid
https://www.turbosquid.com/
Design Connected
https://designconnected.com/Freebies/
Archive 3d
https://archive3d.net/
3d Export
https://3dexport.com/free-3d-models
Cadnav
https://www.cadnav.com/3d-models/
All 3d Free
https://www.all3dfree.net/
3DXO
https://www.3dxo.com/textures
Sketchup Texture
https://sketchuptextureclub.com/
The Ultimate
Next 14 Course