glTF 骨架动画和节点层次结构。如何组合它们?

glTF Skelet animation and node hierarchy. How to combine them?

需要一些帮助来理解 glTF 规范。 我为 gltf 格式编写了加载器,但没有蒙皮动画。 如何结合皮肤和节点层次结构中的关节?否添加某个节点两次,并按正确顺序添加所有节点。

考虑在遍历节点层次结构之前使用 "pre-process" 步骤将节点标记为关节。在 three.js 中,我们这样做:

for skin in gltf.skins
  for (joint, jointIndex) in skin.joints
    gltf.nodes[jointIndex].isJoint = true

稍后,我们遍历节点图并将每个节点实例化为Mesh、Light、Bone或其他对象类型。如需更具体的帮助,请随时 open an issue on the glTF repository.