I'm loading a three.js skinned and rigged model, and a bvh mocap animation file.
When I try to apply the bvh animation to the model, I have a wrong oriention on some bones:
As you can see, The orientations of the arm's are wrong.
This is how I load the model and the bvh file:
loader.load( "anim.bvh", function( result ) {
skeletonHelper = new THREE.SkeletonHelper( result.skeleton.bones[ 0 ] );
skeletonHelper.skeleton = result.skeleton; // allow animation mixer to bind to SkeletonHelper directly
var boneContainer = new THREE.Group();
boneContainer.add( result.skeleton.bones[ 0 ] );
scene.add( skeletonHelper );
scene.add( boneContainer );
// play animation
modelLoader.load('model.js', function(geometry, materials){
var originalMaterial = materials[1];
originalMaterial.skinning = true;
mixer = new THREE.AnimationMixer( skeletonHelper );
mixer.clipAction( result.clip ).setEffectiveWeight( 1.0 ).play();
geometry.skeleton = result.skeleton;
animatedMesh = new THREE.SkinnedMesh( geometry, originalMaterial );
scene.add(animatedMesh);
mixer2 = new THREE.AnimationMixer(animatedMesh);
var action = mixer2.clipAction(result.clip);
action.play();
});
});
The bvh file and the model file have exactly the same skeleton. Would you have an idea of where it can come from?
Thanks