[英]Add gltf-model to a-frame scene via three.js
How to load gltf-model to a-frame scene via three.js loader directly using javascript, not a-frame tags? 如何直接使用javascript(而非a-frame标签) 通过three.js加载程序将gltf-model加载到a-frame场景 ?
The model will have animation, and further I would like to control this animation via three.js too. 该模型将具有动画,此外,我也想通过three.js控制此动画。
Thanks in advance. 提前致谢。
You should create a component , which consists of the three.js gltf loader , like this: 您应该创建一个组件 ,该组件由three.js gltf loader组成 ,如下所示:
AFRAME.registerComponent("model-loader",
init:function() {
//three js loader code + attaching it to the entity's object3D
}
});
Since i had trouble with multiple animations using the khronos exporter , If you want to have many of them try using three.js JSON . 由于我在使用khronos导出器处理多个动画时遇到麻烦, 因此 ,如果要使用许多动画,请尝试使用three.js JSON 。
If you have trouble with any of the steps, i'd say each of them require separate attention, so please create less broad questions. 如果您在任何一个步骤上都遇到麻烦,我想说每个步骤都需要分别关注,因此请提出较不广泛的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.