Results 1 to 2 of 2

Thread: Problem with applying texture to GridGeometry

  1. #1
    Join Date
    Jul 2021
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with applying texture to GridGeometry

    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

    Qt Code:
    1. Model {
    2. id: model;
    3. visible: true
    4. scale: Qt.vector3d(100.0, 100.0, 100.0)
    5. geometry: GridGeometry {
    6. horizontalLines: 40
    7. horizontalStep: 0.1
    8. verticalLines: 40
    9. verticalStep: 0.1
    10. }
    11.  
    12. materials: [
    13. DefaultMaterial {
    14. id: material;
    15. Texture {
    16. id: baseColorMap
    17. source: "qrc:/Images/gradient_texture.png"
    18. }
    19. blendMode: DefaultMaterial.SourceOver;
    20. lighting: DefaultMaterial.FragmentLighting;
    21. opacity: 1.0;
    22. diffuseMap: baseColorMap
    23. }
    24. ]
    25. }
    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!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with applying texture to GridGeometry

    Please do not double-post. If you do not get an answer to your original post, that usually means that either no one knows the answer or no one who does know has read it and responded.

    Closing this thread. Make replies to the original post, here.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 0
    Last Post: 15th June 2022, 07:11
  2. Replies: 3
    Last Post: 14th April 2012, 10:44
  3. Replies: 3
    Last Post: 9th July 2011, 09:19
  4. Replies: 3
    Last Post: 22nd August 2010, 10:23
  5. Problem applying setWindowOpacity to a custom Widget
    By yellowmat in forum Qt Programming
    Replies: 8
    Last Post: 1st November 2006, 11:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.