animation loader three js
// instantiate a loader
const loader = new THREE.AnimationLoader();
// load a resource
loader.load(
// resource URL
'animations/animation.js',
// onLoad callback
function ( animations ) {
// animations is an array of AnimationClips
},
// onProgress callback
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// onError callback
function ( err ) {
console.log( 'An error happened' );
}
);