简体   繁体   中英

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?

The model will have animation, and further I would like to control this animation via three.js too.

Thanks in advance.

You should create a component , which consists of the three.js gltf loader , like this:

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 .

If you have trouble with any of the steps, i'd say each of them require separate attention, so please create less broad questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM