使用QT和QML如何绕特定原点旋转网格



我已经从blender中导入了几个3D网格来形成人形,我想围绕特定的原点旋转手臂网格,使其看起来像手臂的正常运动。为了显示网格,它需要包含在Entity类中,尽管我不能在实体类内部使用Rotation属性,实体类本身具有origin属性。是否有一种方法可以围绕特定点旋转网格?

下面是我的代码。我必须旋转肩部网格,但它不会绕特定原点旋转,因此它的旋转与正常的身体运动不匹配

Entity{
    Mesh {
        id: rightShoulder
        source: "objects/RightShoulder2.obj"
    }
    Transform {
        id: RightShoulderTransform
        Scale { scale3D: Qt.vector3d(1.5, 1, 1.5) }
        Rotate {
           id:RightShoulderRotation
           angle: headSlider.value
           axis: Qt.vector3d(0, 1, 0)
        }
        Entity {
           id: headEntity
           components: [rightShoulder, material, RightShoulderTransform]
        }
   }
}

我找到了解决它的方法。Blender编辑器空间的中心是对象的"原点"。像这样:"起源"

网格中的绿点是所选对象的原点

最新更新