2


如何直接使用javascript而不是a-frame标签通过three.js加载器将gltf-model加载到a-frame场景?

该模型将具有动画,并且我还想通过three.js来控制这个动画。

提前致谢。

4

1 回答 1

0

您应该创建一个组件,它由 three.js gltf loader组成,如下所示:

AFRAME.registerComponent("model-loader",
   init:function() {
   //three js loader code + attaching it to the entity's object3D
   }
});

由于我在使用khronos 导出器时遇到了多个动画的问题,如果您想要其中的许多动画,请尝试使用three.js JSON

如果您对任何步骤有疑问,我会说每个步骤都需要单独注意,所以请提出不太广泛的问题。

于 2018-02-21T22:49:45.990 回答