Description
Using mesh model it is possible to have different textures assigned to different parts of model this way:
Model { source: "qrc:/meshes/distortedcube.mesh" //geometry: MeshData PrincipledMaterial { id: frontTop_material baseColor: "red" cullMode: Material.NoCulling lighting: PrincipledMaterial.NoLighting } PrincipledMaterial { id: frontBottom_material baseColor: "green" cullMode: Material.NoCulling lighting: PrincipledMaterial.NoLighting } materials: [ frontTop_material, frontBottom_material ] }
One part (submesh) of the model is painted with frontTop_material and for the other frontBottom_material is used.
If a model is loaded via QQuick3DGeometry, it is not possible to set which material should be used for each triangle. There is no attribute wich could be used to define material index and the first material from the list is always used for all triangles.
To solve this problem the model can be split into several models, but it's not very handy and a better solution would be to add another attribute which can be used to specify the material index.