All paths

Computer graphics from scratch

Write every pixel yourself in C++ on an ESP32-C3: framebuffers, lines, circles, matrices, perspective and wireframes, ending with a spinning space station.

ESP32-C3-DevKitM-1Free7 lessons6 h4 chapters2,386 XPCoding · Advanced+250 XP

0 of 7 done

What you will build

3 projects, built step by step

7 lessons in 4 chapters, about 6 hours on a simulated ESP32-C3-DevKitM-1. Free, in your browser, every step checked by the simulator.

Chapter 1 project

Bresenham lines

Draw a straight line on a grid with whole numbers only, trace the error term pixel by pixel, race it against floats, and fan a starburst.

Open it in the simulator
Chapter 2 project

Transforms

Turn, move and scale a satellite outline with 2D matrices, prove that the order of transforms matters, and spin it on the screen.

Open it in the simulator
Chapter 3 project

Wireframes

Turn, project, clear, draw, flush: spin a wireframe cube at 26 frames a second, profile every frame, and swap the model for your own.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

Pixels and lines

A picture in RAM, and the whole-number line every renderer still uses.

  1. Open250 XP

    Framebuffers

    Hold a picture in RAM, one byte a pixel, draw a starfield and a planet into it, count and checksum it, and send it to the screen in one go.

    0 of 5 steps

  2. ProjectLocked500 XP

    Bresenham lines

    Draw a straight line on a grid with whole numbers only, trace the error term pixel by pixel, race it against floats, and fan a starburst.

    0 of 5 steps

5 questions, graded as you go.
Chapter 2

Shapes and transforms

Circles, fills and the matrices that turn, move and scale anything.

  1. Locked250 XP

    Circles and fills

    Draw a circle with the midpoint rule and eight-way symmetry, fill a disc from spans, and flood a crater floor with a ring-buffer queue.

    0 of 5 steps

  2. ProjectLocked424 XP

    Transforms

    Turn, move and scale a satellite outline with 2D matrices, prove that the order of transforms matters, and spin it on the screen.

    0 of 4 steps

4 questions, graded as you go.
Chapter 3

Into 3D

Divide by depth, then spin a wireframe and profile every frame.

  1. Locked212 XP

    3D projection

    Divide by depth: project a cube's eight corners onto the screen by hand, then move the camera and change its lens and watch perspective change.

    0 of 4 steps

  2. ProjectLocked500 XP

    Wireframes

    Turn, project, clear, draw, flush: spin a wireframe cube at 26 frames a second, profile every frame, and swap the model for your own.

    0 of 5 steps

4 questions, graded as you go.
Chapter 4

Boss

A space station built in code and flown from the game pad.

  1. Locked250 XP

    Boss: a spinning space station

    A wireframe space station built in code (hub, ring, spokes and solar panels), spun and tilted from the game pad, with depth shading on the far side.

    0 of 5 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

Pixels and lines

  1. FramebuffersHold a picture in RAM, one byte a pixel, draw a starfield and a planet into it, count and checksum it, and send it to the screen in one go.
  2. Bresenham linesDraw a straight line on a grid with whole numbers only, trace the error term pixel by pixel, race it against floats, and fan a starburst.
Chapter 2

Shapes and transforms

  1. Circles and fillsDraw a circle with the midpoint rule and eight-way symmetry, fill a disc from spans, and flood a crater floor with a ring-buffer queue.
  2. TransformsTurn, move and scale a satellite outline with 2D matrices, prove that the order of transforms matters, and spin it on the screen.
Chapter 3

Into 3D

  1. 3D projectionDivide by depth: project a cube's eight corners onto the screen by hand, then move the camera and change its lens and watch perspective change.
  2. WireframesTurn, project, clear, draw, flush: spin a wireframe cube at 26 frames a second, profile every frame, and swap the model for your own.
Chapter 4

Boss

  1. Boss: a spinning space stationA wireframe space station built in code (hub, ring, spokes and solar panels), spun and tilted from the game pad, with depth shading on the far side.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Computer graphics from scratch

Is Computer graphics from scratch free?

Yes. All 7 lessons of Computer graphics from scratch are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real ESP32-C3-DevKitM-1?

No. Every lesson runs on a simulated ESP32-C3-DevKitM-1 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Computer graphics from scratch take?

About 6 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Bresenham lines, Transforms and Wireframes.

Where do I start?

With "Framebuffers", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.