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. How to add texture to 3D obj in Entity element in qml in Qt 5.5?
Forum Updated to NodeBB v4.3 + New Features

How to add texture to 3D obj in Entity element in qml in Qt 5.5?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 768 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.
  • NeerajaN Offline
    NeerajaN Offline
    Neeraja
    wrote on last edited by
    #1

    The following code snippet shows how I have tried to add texture to the .obj file.
    This is the error message:
    Texture data is null, texture data failed to load

    Entity {
    property Material materialSpeedometer: PMaterial{}
    components: [
    Mesh {
    source: "assets/obj/speedmeter3.obj"

             PMaterial {
                effect: shadowMapEffectDB
               ambientLight: "blue"
                specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
                diffuseMap: "C:/Qt/Qt5.5.0/Examples/Qt-5.5/qt3d/exampleresources/assets/obj/Speedometer_01.JPG"
                normalMap: "C:/Qt/Qt5.5.0/Examples/Qt-5.5/qt3d/exampleresources/assets/obj/Speedometer_01.JPG"
               shininess: shininessSpecularMap
            }
    
    
        ]
    

    }

    PS: PMaterial is a separate qml defining different Material Parameters.

    Please describe the correct way to load texture .
    Thanks.

    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