【发布时间】:2015-02-26 10:21:37
【问题描述】:
JSON 模型是在 Blender 中创建的,动画也是在 Blender 中使用骨骼制作的。 但是当我尝试在 three.js 中运行动画时,除了鱼之外,场景的其余部分都被显示出来了。我一直在寻找答案,但没有找到任何可以解决我的问题的方法。我正在关注 Jos Dirksen 的《Learning three.js》一书。我也是three.js的初学者
var loader=new THREE.JSONLoader();
var mesh;
loader.load('fish_anim1.json', function (model, mat){
mat[0] = new THREE.MeshLambertMaterial({color: 0x9ABF15, skinning: true});
mesh = new THREE.SkinnedMesh(model, mat[0]);
animation = new THREE.Animation(model, model.animations);
mesh.position.set(0,5,0);
mesh.scale.x = 3;
mesh.scale.y = 3;
mesh.scale.z = 4;
mesh.rotation.y=Math.PI;
mesh.name='fish'+fish_count;
scene.add(mesh);
animation.play();
});
在渲染循环中,我添加了这一行来更新动画
THREE.AnimationHandler.update(delta);
【问题讨论】:
标签: javascript json three.js blender