apply animation to imported model

Hi guys,

I have a project using Three.js to display simulation, here’s the step:

1, export model in obj file, export the animation data in customized json file.

2, load the obj file in three.js and apply animation to the imported model.

It works great till I try to upgrade three.js to r86, which have a brand new animation system.

I’ve tried to apply animation to imported model with r86, but I can’t use any animation function outside loaders…

I know I can export the model and animation in other file format and convert old file to new ones,

but don’t you think it would be more comfortable to have tools to apply customized animation outside loaders?

or any idea for work-around?

That’s probably the best thing to do here. Use FBX or glTF format if possible.

Thanks for your advise, but why FBX or giTF is better than other format like json, or colloda?

The file sizes will be smaller and support for loaders and exporters will be better. In general, the best-supported formats for three.js are Collada, OBJ, FBX and glTF.

However OBJ doesn’t support animations, and Collada file sizes will be bigger. The three.js JSON format was created at a time when there was no good web format for 3D assets, however, it’s slowly being replaced by glTF.

glTF is the recommended format going forward, but not all applications have good exporters yet - in particular, if you’re using Autodesk products then FBX will be easier.

Hi looeee,

Thanks for your specific information~

It seems that gltf/glb is the best file format for 3d things.

Is there any easy way to write my mesh data into glb/gltf file format?
Or any C++ project to generate glb or gltf file?


See list of tools here:

I recommend starting with Blender or one of the converters typically, but there are also C++ utilities.