1

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:

Wrong Bones orientation

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

  • either the resting pose is different between your model and BVH ( see [How to parse a bvh file to a skeleton model made in OpenGL?](https://stackoverflow.com/a/52699028/2521214) ) or you wrongly parsed the BVH (ignoring the order of transformations or using different notations) – Spektre Oct 10 '18 at 13:43

0 Answers0