1
我在某些fbx模型上遇到动画问题。如果我有,例如一个持续20秒的动画,模型将保持静止19秒,然后所有的变化将在最后一秒左右发生。在其他fbx模型上,动画运行正确。 ,我使用运行动画的代码是如下: 的Loader.load方法回调是:FBX动画与三个js无法正常运行
var clock = new THREE.Clock();
var mixers = [];
function(object){
object.position.set(0,0,0);
object.mixer = new THREE.AnimationMixer(object);
mixers.push(object.mixer);
console.log(object);
for (var a = 0; a < object.animations.length; a++){
var action = object.mixer.clipAction(object.animations[a]);
action.play();
console.log(action);
}
scene.add(object);
animate();
}
而且动画代码:
function animate() {
requestAnimationFrame(animate);
for(var i = 0; i < mixers.length; i++){
mixers[i].update(clock.getDelta());
}
render();
stats.update();
}
function render() {
if (mixer) {
mixer.update(clock.getDelta());
}
renderer.render(scene, camera);
}
任何想法?谢谢!