Qt Quick 3D: Building Real-World 3D Applications
1 of 126 What you will build
Chapter 0: Getting ready · Lesson 1 of 126

What you will build

This course builds four real applications in Qt Quick 3D, from an empty folder to a finished, tested program, by writing the code yourself one lesson at a time. Each one is a kind of software people are paid to build with Qt: a building management display, a car’s instrument cluster, a control room screen for a process plant, and a live digital twin of a warehouse. Every picture on this page is one of them, running.

Four applications

A building, floor by floor

Project 1, the BMS Floor Viewer, as chapter 6 leaves it: the camera riding between storeys, each one fading as the camera leaves it, and every room coloured by its temperature. Played at five times speed.
Project 1, the BMS Floor Viewer, as chapter 6 leaves it: the camera riding between storeys, each one fading as the camera leaves it, and every room coloured by its temperature. Played at five times speed.

Chapters 2 to 6. A three-storey office building made of nothing but Qt Quick 3D’s built-in primitives, driven by a model of zones and floors in C++. You build the scene from reusable components, light it with shadows and an HDR environment, fly the camera between floors, colour every room from its sensor data with animated transitions, pick rooms with the mouse, float labels over them that follow the camera, and feed it all from a REST service. It ends with the interlude every 3D application needs and few courses teach: measuring what a frame costs, and a budget to hold it to.

A car’s instrument cluster

Project 2, the Automotive Digital Cluster, as chapter 11 leaves it, switching drive mode every one and a half seconds. The paint, the lighting and the effects change together.
Project 2, the Automotive Digital Cluster, as chapter 11 leaves it, switching drive mode every one and a half seconds. The paint, the lighting and the effects change together.

Chapters 7 to 11. Three 3D viewports in one window, the speedometer and tachometer built procedurally from primitives, and a car imported from glTF with Qt’s balsam and audited rather than trusted. Then the part most Qt Quick 3D material stops short of: your own shaders, a metallic car paint in GLSL, drive modes that cross-fade their materials and environments, post-processing with glow, ambient occlusion and a vignette that turns red for an alarm, and telltale lamps fed over MQTT.

A plant control room

Project 3, the Industrial Plant HMI, as chapter 16 leaves it, running from about 83 seconds: steam off the mixer, the leak detector under the product line's flange reading Wet, and every vessel at its level.
Project 3, the Industrial Plant HMI, as chapter 16 leaves it, running from about 83 seconds: steam off the mixer, the leak detector under the product line's flange reading Wet, and every vessel at its level.

Chapters 12 to 16. A process plant of tanks, pipes and conveyors, instanced so that two hundred rollers stop costing two hundred draw calls, with liquid surfaces and the equipment inside the vessels generated in C++ with QQuick3DGeometry. Particle systems for steam, electrical sparks and a leak, all held to the plant’s clock so a picture can be retaken to the pixel. Billboards and sensor labels that declutter themselves, a second orthographic view of the same scene, MQTT and AMQP at once, and then a whole chapter on testing what you can see: Qt Test, headless rendering and golden images.

A warehouse, live

Project 4, the Warehouse Digital Twin, as chapter 21 leaves it, running from about 295 seconds at three times speed: three robots on their missions with their pins and trails, the heat map of where they have been, the plan redrawn five times a second, and the dashboard.
Project 4, the Warehouse Digital Twin, as chapter 21 leaves it, running from about 295 seconds at three times speed: three robots on their missions with their pins and trails, the heat map of where they have been, the plan redrawn five times a second, and the dashboard.

Chapters 17 to 21. The largest scene in the course, and the one that changes while it runs. Racks created and destroyed at runtime, loaded asynchronously, dragged, snapped and refused where they would collide, and saved to a file. Two instanced draw calls per rack, level of detail, and a floor that reflects the racks through a reflection probe. Robots driving centripetal Catmull-Rom routes on a simulated clock, with missions, zone lights they wake, fading trails and a Qt Graphs dashboard. A heat map drawn by a custom material from a texture your C++ fills, a minimap rendered to a texture, and live data over MQTT, HTTP and AMQP. The last chapter profiles the finished twin and ships the one change that pays for itself.

Along the way

The applications are the vehicle; these are some of the techniques they carry. Each loop below is lifted from the lesson that teaches it.

Lesson 17.3: a rack carried across the floor by the mouse, with a ray cast from the pointer onto the floor plane.
Lesson 17.3: a rack carried across the floor by the mouse, with a ray cast from the pointer onto the floor plane.
Lesson 14.3: sparks from a motor's terminal box, a particle system of static bursts on the fault's own clock.
Lesson 14.3: sparks from a motor's terminal box, a particle system of static bursts on the fault's own clock.
Lesson 8.4: a procedural needle that never stops and never snaps, because the animation under it never finishes.
Lesson 8.4: a procedural needle that never stops and never snaps, because the animation under it never finishes.
Lesson 19.5: trails as a ribbon of custom geometry, a ring buffer of thirty seconds that fades towards its tail.
Lesson 19.5: trails as a ribbon of custom geometry, a ring buffer of thirty seconds that fades towards its tail.
Lesson 5.2: selection highlighting, a scale that overshoots and settles.
Lesson 5.2: selection highlighting, a scale that overshoots and settles.
Lesson 13.6: a mixer's impeller turning at 45 revolutions a minute inside a transparent vessel.
Lesson 13.6: a mixer's impeller turning at 45 revolutions a minute inside a transparent vessel.

What you will be able to do

By the end you will have written, and understood, each of these:

  • A Qt Quick 3D scene composed from reusable QML components, in real units, lit and shadowed on purpose rather than by default, with every Qt default the scene depends on known and chosen.
  • A 3D view driven by C++ models and live data over REST, MQTT and AMQP, with the transport kept out of everything that draws.
  • Interaction in 3D: picking, dragging on a plane, snapping, collision rules, and 2D overlays that track 3D positions.
  • Several views of one scene, render-to-texture, and an orthographic plan.
  • Geometry from C++ that updates at runtime, instancing for thousands of objects, and level of detail where it pays.
  • Custom materials and effects in GLSL, including data drawn after lighting.
  • Particle systems that a test can photograph.
  • A simulated clock that makes an animated application repeatable, and tests, headless rendering and golden images that prove what it draws.
  • A performance pass measured in CPU per frame by thread, the way to find what a frame costs when the display caps how many you see.

How a lesson works

Every lesson starts from a working application and ends with one. The starter at the top of a lesson is the project exactly as the previous lesson left it, as a zip, so you can join anywhere or recover from a mess. Code arrives in listings with the lines to type marked in green and the lines to delete in red; files you are given rather than asked to write, CMake and the network clients among them, are labelled as such. Nothing in a listing was pasted by hand: every listing, every starter and every picture is generated from one annotated source per project, and every lesson’s end state is built and photographed before it is published.

The pictures are evidence. Animated applications are photographed at a stated second of their own simulated clock, which you can set too, so your window and the figure should show the same moment. When a lesson makes a claim about cost, it was measured, and the lesson says on what: this course’s numbers come from Mesa’s llvmpipe software renderer under a virtual display, which makes them repeatable, and slower than your GPU. The proportions are what to carry over.

Exercises have solutions, and the solutions were built. Each lesson ends with two or three modifications to make. Every answer was checked by applying the change to the real project, building it, running it and photographing it. Several first drafts turned out to be wrong in direction, and were rewritten around what the build showed.

Before chapter 1

This chapter is the rest of the setup, and it is skippable if you already have it:

  • 0.2 installs Qt 6.10 with the modules the course uses, and checks them with a small program.
  • 0.3 builds the project that chapter 1 grows, from the command line, on Linux, Windows or macOS.
  • 0.4 and 0.5 refresh the QML and C++ integration that every later lesson assumes.

If you are fluent in QML and have built a Qt 6 CMake project this year, install the modules in 0.2, take lesson 1.1’s starter and begin.

This is a free preview lesson.

Get the full course to unlock the rest of the curriculum.

0 of 126 lessons done so far.