Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Three.js JSON(blender导出)动画_Json_Three.js_Blender - Fatal编程技术网

Three.js JSON(blender导出)动画

Three.js JSON(blender导出)动画,json,three.js,blender,Json,Three.js,Blender,我似乎无法在three.js中设置此模型的动画。 我尝试了很多不同的方法导出它,但我不确定是模型还是代码。我从模型中得到了动画的跟踪,但是在回拨时什么也没有发生。有什么想法吗 new THREE.JSONLoader().load( 'assets/model/Gunnar.json', function ( model, material ) { var mesh = new THREE.SkinnedMesh(model, material); scene.add( mesh ); me

我似乎无法在three.js中设置此模型的动画。 我尝试了很多不同的方法导出它,但我不确定是模型还是代码。我从模型中得到了动画的跟踪,但是在回拨时什么也没有发生。有什么想法吗

new THREE.JSONLoader().load( 'assets/model/Gunnar.json', function ( model, material ) {

var mesh = new THREE.SkinnedMesh(model, material);
scene.add( mesh );

mesh.scale.x = mesh.scale.y = mesh.scale.z = 5;

var clips = model.animations;
mixer = new THREE.AnimationMixer( mesh );
mixer.clipAction( clips[0] ).play();

loaded = true;
animate();

} );


function animate() {

requestAnimationFrame( animate );

if (loaded) {
  mixer.update(clock.getDelta());
}

renderer.render( scene, camera );

}
Blender/JSON文件: