Hello
I have a problem with Blender (2.8) exported animation. Its just a simple rotation and location keyframe track on a camera object, to showcase the map. I think the position is okay, but the quaternion rotation track seems very off. Most of the shots are incorrectly aimed at the sky.
Here are my simplified files: (i’ve removed the materials during export to avoid the filesize limit)
files.zip (1.0 MB)
The strange thing is that the animation works well in the https://gltf-viewer.donmccurdy.com (I recommend viewing it there first, to avoid confusion) and both use the same three.js
and gltfLoader.js
files from the r101 version.
Does that mean that I use the animation incorrectly in my file? I load it like so:
gltfLoader.load( ‘/models/anim-test.glb’,
function ( gltf ) {camera0 = gltf.cameras[0]; camera0.fov = 90; camera0.updateProjectionMatrix(); let cam = camera0; cam.animationMixer = new THREE.AnimationMixer( cam ); let camClip = THREE.AnimationClip.findByName( gltf.animations, 'Camera_Move1' ); cam.animations = { startingShow: cam.animationMixer.clipAction( camClip ), }; cam.animations.startingShow.play(); console.log( camera0 ); console.log( gltf ); scene0.add( gltf.scene ); }, function ( xhr ) { // console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' ); }, function ( error ) { console.log( 'Error happened: ' + error); }
);
with the mixer updated in the render loop.