How to handle animated models in Three.js?

I have a basic question about Three.js. I searched googled but didn't find anything useful ... How to handle animated models in Three.js? I know how to import .js files, and I have an animated cube exported from a blender to .js format. I imported it using JSONLoader, but the animation will not play by itself. So where am I, I don’t know how to play it.

I checked the documentation, but I don’t know what I should use ... I tried MorphAnimationMesh, and when I register the length, it finds 250 frames. Therefore, I think the export went well.

I am using WebMatrix and it does not seem to recognize dae files, so I have not tried them yet. And for them, I also don’t know how to handle animations.

Please, help!

+5
source share
2 answers

Three.js sources have many examples . You can also view them online, for example.

There is also another style of animation called skeleton animation or " skinning ". However, if you find 250 frames of morphs, then you do not need to worry about it at the moment, but it is good to know about it. A blender can export both - morphs are more reliable, but skinning takes up less space.

+7
source

I found this example very useful for the game dev:

https://threejs.org/examples/webgl_animation_skinning_blending.html

0
source

All Articles