【问题标题】:Add gltf-model to a-frame scene via three.js通过 three.js 将 gltf-model 添加到 a-frame 场景
【发布时间】:2018-08-01 16:03:30
【问题描述】:


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

模型会有动画,而且我也想通过three.js来控制这个动画。

提前致谢。

【问题讨论】:

标签: javascript animation three.js aframe gltf


【解决方案1】:

你应该创建一个component,它由三个.js gltf loader组成,像这样:

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

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

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

【讨论】:

  • 谢谢它的工作,请编辑括号和最后的分号:)
猜你喜欢
  • 2018-08-02
  • 2018-11-09
  • 2020-08-29
  • 2021-08-11
  • 2019-02-05
  • 2019-05-07
  • 2018-11-23
  • 2017-08-21
  • 1970-01-01
相关资源
最近更新 更多