ABCsteps lesson path

Build Your First 3D Scene

Use Three.js concepts to understand scenes, cameras, lighting, and how AI can help scaffold visual experiments. Build one artifact, keep one review trail, and make the work easy to inspect later.

Lesson
03
Time
45 min
Access
public lesson

Learning objective

Learn the basic mental model behind 3D scenes, cameras, and rendering.

Lab outcome

Create a small Three.js scene and adjust it safely.

Module milestone

Publish a small working app and its GitHub repository.

Lesson proof workflow

Read, build, then review the evidence.

  1. Three.js hero workflow iconStep 1ReadStart with 3D scene model before touching tools.
  2. JavaScript hero workflow iconStep 2BuildBuild toward: Create a small Three.js scene and adjust it safely.
  3. VS Code hero workflow iconStep 3ReviewReview the evidence using Interactive UI logic.

Toolchain

3D work teaches the scene-camera-rendering mental model.

These are the practical surfaces used in this lesson. Learn the habit first, then connect it to the wider engineering ecosystem.

Three.js iconThree.js3D rendering

Build a scene and understand what the renderer is doing.

JavaScript iconJavaScriptWeb runtime

Control objects and interactions in the browser.

VS Code iconVS CodeEditor

Iterate safely while changing visual code.

Proof of work

Leave one inspectable trail from this lesson.

The useful output is not a passive note. It is a small artifact another person can inspect: a working file, a command result, a commit, a screenshot, a README note, or a demo link.

Lesson lab: Create a small Three.js scene and adjust it safely.

Tool and platform logos are ecosystem references only: no affiliation, endorsement, interview access, hiring promise, salary promise, or placement guarantee.

Three.js proof icon

Build

Produce the artifact

Complete the lab and keep the result visible: Create a small Three.js scene and adjust it safely.

JavaScript proof icon

Record

Save review evidence

Capture what changed, what broke, and how 3D scene model became clearer through the work.

VS Code proof icon

Explain

Write the vocabulary

Use your own words for Rendering loop and Interactive UI logic; this is what makes the lesson inspectable later.

Skills companies recognize

Translate the lesson into inspectable work language.

This lesson turns one small lab into the language a learner can use in a README, demo note, or technical conversation. The point is not to collect logos; the point is to explain work clearly enough that another engineer can inspect it.

Where this skill appears

Interactive product teams care about the scene model because visual software still needs engineering discipline.

Web graphicsGame-tech prototypesInteractive product UI

Ecosystem references

GitHub skill ecosystem logoMicrosoft skill ecosystem logoGoogle Cloud skill ecosystem logoAWS skill ecosystem logoOpenAI skill ecosystem logoCloudflare skill ecosystem logoGoogle skill ecosystem logo

Platform and company logos are ecosystem references only: no affiliation, endorsement, interview access, hiring preference, salary outcome, or placement guarantee.

Three.js skill proof icon

README line

Name the artifact

Lab proof: Create a small Three.js scene and adjust it safely. Connect it to 3D scene model so the result reads like work, not a passive note.

JavaScript skill proof icon

Review line

Explain the stack

Use Three.js, JavaScript, VS Code to explain Rendering loop and what changed between the first attempt and the inspected result.

VS Code skill proof icon

Conversation line

Answer with evidence

If a team asks about Interactive UI logic, use this proof line: Show the scene, camera, light, and interaction change separately so another engineer can inspect the rendering path.

Proof translation

Three.js proof translation icon

Skill signal

3D scene model is the market word. The lesson makes it visible through a small working artifact.

JavaScript proof translation icon

Proof artifact

The inspectable artifact is: Create a small Three.js scene and adjust it safely.

VS Code proof translation icon

Interview answer

Use Rendering loop and Interactive UI logic to explain what changed, what failed, and how you verified it.

Paid guidance

Read publicly. Upgrade when guidance will help you finish.

This lesson remains part of the public written syllabus. Paid help is online-only and human-led: video walkthroughs as they roll out, live class context, WhatsApp Q&A, and project review around the same work.

No account wall, automated checkout, or placement promise is introduced here. Enrollment stays human-led by WhatsApp or call, and the useful proof remains the learner's own artifact.

Three.js paid guidance icon

Public

Written lesson stays open

Read the prepare and review material for lesson 03 on the public site before buying anything.

JavaScript paid guidance icon

Recorded

Recorded and live guidance clarify the work

Paid guidance can add founder-led video walkthroughs as they roll out and live online class context; the teaching explains the work, but does not replace the written lesson.

VS Code paid guidance icon

Human

Questions use real context

When stuck, useful guidance starts from the route, error, screenshot, repo fragment, and the lab artifact: Create a small Three.js scene and adjust it safely.

Phase 1 · Briefing

Lesson briefing

Before You Study (5 mins)

Lesson focus: The same rendering technology that powers parts of Fortnite, Google Earth, and most modern web games is free, browser-native, and accessible through a JavaScript library called Three.js. Today we go from a 2D Snake game to a small 3D scene — and the goal is not to build the next Fortnite. The goal is to internalize the mental model of how 3D actually works on a flat screen, so the next time you read 3D code, it feels like reading a story instead of decoding hieroglyphics.

What you should have ready:

  • VS Code from Lesson 02, configured and ready
  • Your project folder with the Snake game
  • An open mind — 3D feels intimidating, but the math is doing the heavy lifting; you're orchestrating
  • About 60 minutes; the first 30 are reading, the next 30 are typing

The Concept

Every 3D scene rendered in a browser is the same recipe: a Scene, a Camera, and a Renderer. Memorize this triple and the rest follows.

  • A Scene is the 3D world. It contains every object you place inside it — meshes, lights, helpers. Think of it as an empty stage.
  • A Camera is the viewer's eye. It has a position (where in the world it sits), a direction (where it's looking), and a field of view (how wide its lens is). Move the camera, and everything looks different.
  • A Renderer is the painter that takes the Scene and the Camera and produces a 2D image of pixels — frame after frame, sixty times a second.

The library that makes this accessible from JavaScript is Three.js, originally created by Ricardo Cabello (mr.doob). Under the hood, Three.js calls WebGL — a browser API that lets JavaScript send instructions to the GPU on your laptop or phone. The GPU is the part of your hardware that exists specifically to do millions of small math operations in parallel. That is what makes 3D fast enough to feel real-time.

Every 3D object in a Three.js scene is a Mesh — a combination of two things:

  • Geometry — the shape: a list of vertices (points in 3D space) connected into triangles. A cube is 8 vertices, 12 triangles. A sphere is many more.
  • Material — how the surface looks: color, shininess, transparency, whether it's affected by light. Same geometry + different material = same shape, different look.

To position anything in 3D, you use three coordinates: X (left/right), Y (up/down), Z (forward/back). By Three.js convention, the camera looks down the negative-Z axis — so an object placed at (0, 0, -5) sits five units in front of the default camera. This convention varies between engines (Unity uses Y-up; Blender uses Z-up); knowing your engine's convention is the first thing to check when an object "appears in the wrong place."

The animation loop is the final piece. To make 3D move, you call renderer.render(scene, camera) inside a function that runs every frame, scheduled by requestAnimationFrame. Each frame, you change something (an object's position, the camera's angle, a light's intensity) and re-render. Sixty times per second; smooth enough to look continuous.

The math behind 3D — perspective projection, transformation matrices, the dot products that compute lighting — is genuinely deep, and you don't need to derive it to use it. Three.js handles the math; you handle the artistic and architectural choices. As your work gets ambitious, you'll dip into the math one piece at a time. For now, build the model in your head, write the recipe, and let the GPU do the rest.

Quick Concepts

TermSimple Meaning
Three.jsThe JavaScript library that makes 3D in the browser approachable
WebGLThe browser API Three.js calls to talk to your GPU
SceneThe 3D world — a container for everything you'll see
CameraThe eye that views the scene
RendererThe painter that turns scene + camera into pixels
MeshA 3D object = Geometry (shape) + Material (look)
(X, Y, Z)Coordinates: left/right, up/down, forward/back

What We Will Build

By the end of this lesson, you will have done these specific things:

  1. Created a fresh HTML file (3d-scene.html) and added a single <canvas> element where the 3D rendering will land.
  2. Pulled in Three.js via a CDN script tag (no npm setup needed for this lesson).
  3. Created a Scene, a PerspectiveCamera, and a WebGLRenderer in JavaScript.
  4. Built one Mesh: a cube made of BoxGeometry + MeshStandardMaterial. Added it to the scene.
  5. Added one light: a DirectionalLight (without lights, MeshStandardMaterial appears black).
  6. Written an animation loop using requestAnimationFrame that rotates the cube on each frame.
  7. Loaded the page and watched a colored cube rotate smoothly in the browser window.
  8. Asked the AI assistant to convert the cube into a snake-shaped chain of cubes — one cube per snake segment — and observed how the geometry changes while the rendering pipeline stays identical.

Steps 7 and 8 are the goal. Once you have a rotating cube, the recipe is unlocked: every 3D scene you build for the rest of your life is a variation of Scene, Camera, Renderer, Mesh, Light, animate.

Think About

Before studying, consider:

  1. Your screen is a flat 2D grid of pixels. How does the computer turn a "cube" — a thing with depth — into colors on flat pixels? (Hint: perspective projection is just trigonometry, and the GPU does it for you.)
  2. If a game runs at 60 frames per second, your animation function runs 60 times every second. What does that say about how cheap each individual frame's computation must be?

By the End

After this lesson, you'll:

  • ✅ Understand the Scene–Camera–Renderer triple and never forget it
  • ✅ Know what a Mesh is (geometry + material) and why both matter
  • ✅ Be able to read a Three.js coordinate system without confusion
  • ✅ Have a working rotating-cube scene in your browser
  • ✅ Have shipped a 3D version of one element from your Snake game

Welcome to the third dimension. The math runs on the GPU; you run the story. 🧊

Next lesson · 04

How Developers Actually Work: The Terminal

The terminal is a precise control surface. Learn the commands developers use to inspect projects and run tools.

Git next lesson iconNode.js next lesson iconJSON next lesson icon