qml将纹理应用于.obj

时间:2016-09-16 23:47:58

标签: qt qml qt3d

我正在尝试将三维人体目标文件添加到场景中,但我目前对如何向网格添加纹理感到困惑。我尝试在'id:humanMaterial'下应用.webp纹理,但它崩溃了应用程序。

RenderableEntity{
    id: human3d
    source: "/image/FinalBaseMesh.obj"
    scale: 1.5
    position: Qt.vector3d(0.0, -16.0, 0.0)

    material: NormalDiffuseMapMaterial{
        id:humanMaterial
    }

RenderableEntity.qml

import Qt3D.Core 2.0
import Qt3D.Render 2.0

Entity {
id: root

property vector3d position: Qt.vector3d(0, 0, 0)
property real scale: 1.0
property real rotationAngle: 0.0
property vector3d rotationAxis: Qt.vector3d(1, 0, 0)
property alias source: mesh.source
property Material material

components: [ transform, mesh, root.material ]

Transform {
    id: transform
    scale: root.scale
    rotation: fromAxisAndAngle(root.rotationAxis, root.rotationAngle)
    translation: root.position
}

Mesh {
    id: mesh
}

}

0 个答案:

没有答案