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

Loading a 3D scene

The Mesh component is useful when you want to import a single object's shape from an external file. However, sometimes you want to import multiple objects from a single file. For example, you could prepare some decorations surrounding your game action and then import them all at once. This is where the SceneLoader component becomes useful.

It can be used similar to the Mesh component:

Entity {    components: [        SceneLoader {            source: "path/to/scene/file"        }    ]}

However, instead of providing shape for its entity, SceneLoader creates a whole tree of Entity objects that become children of the SceneLoader's entity. Each new entity will be provided with a mesh, a material, and a transform according to the file data. SceneLoader uses Assimp ...

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