Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem with applying texture to GridGeometry
Qt 6.11 is out! See what's new in the release blog

Problem with applying texture to GridGeometry

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 180 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike25
    wrote on last edited by
    #1

    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
    }
    ]
    }

    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!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved