【问题标题】:Using QT and QML how to rotate a mesh about a specific origin使用 QT 和 QML 如何围绕特定原点旋转网格
【发布时间】:2016-02-09 10:40:27
【问题描述】:

我从搅拌机中导入了几个 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]
        }
   }
}

【问题讨论】:

    标签: qt 3d rotation qml qtquick3d


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2017-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-07
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多