I am having trouble animating in Three.js, I'm not sure if the problem is in my code or my blender file.
Here is the code I use to load and animate the model, please tell me if there is something wrong with it.
loader.load('model.js', function (geometry, materials) {
var mesh, material;
mesh = new THREE.SkinnedMesh(
geometry,
new THREE.MeshFaceMaterial(materials)
);
material = mesh.material.materials;
for (var i = 0; i < materials.length; i++) {
var mat = materials[i];
mat.skinning = true;
}
scene.add(mesh);
THREE.AnimationHandler.add(mesh.geometry.animation);
animation = new THREE.Animation(
mesh,
'ArmatureAction',
THREE.AnimationHandler.CATMULLROM
);
animation.play();
Thanks in Advance!