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. Qml 3D 5.8 version how can i load file.mtl of the obj ?
Forum Updated to NodeBB v4.3 + New Features

Qml 3D 5.8 version how can i load file.mtl of the obj ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 1.9k Views 1 Watching
  • 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.
  • Everton FonsecaE Offline
    Everton FonsecaE Offline
    Everton Fonseca
    wrote on last edited by
    #1

    Guys i I have been trying load cube.obj together with its cube.mtl Blender

    import QtQuick 2.0
    import Qt3D.Core 2.0
    import Qt3D.Render 2.0
    import Qt3D.Extras 2.0

    Entity {

    id: senario
    
    Mesh {
    
        id: mesh
        source: "cube.obj"
    
    }
    

    // PhongMaterial{

    // id: material
    // ambient: "blue"
    // diffuse: "red"
    // shininess: 1
    // specular: "lightblue"
    // }

    Transform{
    
        id: transform
        translation: Qt.vector3d(0,0,0)
        scale3D: Qt.vector3d(1,1,1)
        rotation: fromAxisAndAngle(Qt.vector3d(0,1,0),angle)
        property real angle: 0
    
    }
    
    RotationAnimation {
    
        target: transform
        property: "angle"
        duration: 3500
        from: 0
        to: 350
        running: true
        easing.type: Easing.InOutQuad
        loops: Animation.Infinite
    }
    
    components: [transform,mesh]
    

    }

    and when load obj in the scene the cube isn't show, I just want to use the cube with its cube.mtl to qml scene, there is any example?

    Everton FonsecaE 1 Reply Last reply
    1
    • Everton FonsecaE Everton Fonseca

      Guys i I have been trying load cube.obj together with its cube.mtl Blender

      import QtQuick 2.0
      import Qt3D.Core 2.0
      import Qt3D.Render 2.0
      import Qt3D.Extras 2.0

      Entity {

      id: senario
      
      Mesh {
      
          id: mesh
          source: "cube.obj"
      
      }
      

      // PhongMaterial{

      // id: material
      // ambient: "blue"
      // diffuse: "red"
      // shininess: 1
      // specular: "lightblue"
      // }

      Transform{
      
          id: transform
          translation: Qt.vector3d(0,0,0)
          scale3D: Qt.vector3d(1,1,1)
          rotation: fromAxisAndAngle(Qt.vector3d(0,1,0),angle)
          property real angle: 0
      
      }
      
      RotationAnimation {
      
          target: transform
          property: "angle"
          duration: 3500
          from: 0
          to: 350
          running: true
          easing.type: Easing.InOutQuad
          loops: Animation.Infinite
      }
      
      components: [transform,mesh]
      

      }

      and when load obj in the scene the cube isn't show, I just want to use the cube with its cube.mtl to qml scene, there is any example?

      Everton FonsecaE Offline
      Everton FonsecaE Offline
      Everton Fonseca
      wrote on last edited by
      #2

      Blender MTL File: 'None'

      Material Count: 1

      newmtl Material.001
      Ns 92.156863
      Ka 0.000000 0.000000 0.000000
      Kd 0.000000 0.512000 0.047945
      Ks 0.018321 0.016265 0.500000
      Ni 1.000000
      d 1.000000
      illum 2

      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