O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required