Kuesa Iro-Materials-Gallery QML Example¶
Demonstrates the appearance of the different [Digital Content Creation Plugins] Iro Materials that can be bundled in a glTF file.
QtQuick and Qt3D integration¶
The iro-materials-gallery relies on the regular QtQuick and Qt 3D APIs to instantiate a QtQuick based application that combines Qt 3D based content with a 2D UI overlay.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Filename: iro-materials-gallery/qml/main.qml
SceneEntity¶
Kuesa provides the [SceneEntity ] element which holds collections of Qt 3D assets accessible by name.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Filename: iro-materials-gallery/qml/MainScene.qml
Importing a glTF2 File¶
In order to load a glTF2 file, Kuesa provides the [GLTF2Importer ] element. If the sceneEntity property is set to a valid [SceneEntity ] instance, Qt 3D assets generated while parsing the file will be automatically added to the various asset collections.
The [GLTF2Importer ] takes care of intantiating the Kuesa Iro Materials
1 2 3 4 5 6 7 |
|
Filename: iro-materials-gallery/qml/MainScene.qml
Handling Picking¶
We want to display the material properties of the sphere on which we click. To do that, we can simply use the ObjectPicker element provided by Qt3D.
1 2 3 4 5 6 |
|
Filename: iro-materials-gallery/qml/MainScene.qml
We can react to the clicked signal and call some C++ function to perform some introspection and retrieve material properties.
Updated on 2023-07-03 at 11:02:17 +0000