Dear All,
I am working on a project in which I have to apply texture (via png file) to the GridGeometry.
To apply the Texture, I am using the DiffuseMap property of materials. As shown in the following code
Model {
id: model;
visible: true
scale: Qt.vector3d(100.0, 100.0, 100.0)
geometry: GridGeometry {
horizontalLines: 40
horizontalStep: 0.1
verticalLines: 40
verticalStep: 0.1
}
materials: [
DefaultMaterial {
id: material;
Texture {
id: baseColorMap
source: "qrc:/Images/gradient_texture.png"
}
blendMode: DefaultMaterial.SourceOver;
lighting: DefaultMaterial.FragmentLighting;
opacity: 1.0;
diffuseMap: baseColorMap
}
]
}
Model {
id: model;
visible: true
scale: Qt.vector3d(100.0, 100.0, 100.0)
geometry: GridGeometry {
horizontalLines: 40
horizontalStep: 0.1
verticalLines: 40
verticalStep: 0.1
}
materials: [
DefaultMaterial {
id: material;
Texture {
id: baseColorMap
source: "qrc:/Images/gradient_texture.png"
}
blendMode: DefaultMaterial.SourceOver;
lighting: DefaultMaterial.FragmentLighting;
opacity: 1.0;
diffuseMap: baseColorMap
}
]
}
To copy to clipboard, switch view to plain text mode
However, the texture of GridGeometry is not changing.
I have searched online extensively for this issue, but I have not found anything useful for this issue. Can somebody please point me in the right direction?
Thank you for your time!
Bookmarks