Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
What just happened?
We added a few objects to our scene graph. First, the FirstPersonCameraController object allows the user to freely control the camera. This is quite useful for testing the game while you don't have your own camera controlling code yet. Next, an entity with a single DirectionalLight component works as a light source in the scene. We use the properties of this component to set the color, intensity, and direction of the light.
Finally, we added an entity that represents a regular 3D object. Its shape is provided by the CuboidMesh component that generates a unit cube. The appearance of its surface is defined by the DiffuseSpecularMaterial component that conforms to the widely used Phong reflection model. You can use ambient ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access