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



  • 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?



  • 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


Log in to reply