When I use SkeletonUtils.retargetClip to redirect the BVH animation, the bones of gltf are reduced, so the skins are squeezed together. What causes this?
const loader = new BVHLoader();
loader.load("01_04.bvh", function (bvhResult) {
const bvhSkeletonHelper = new THREE.SkeletonHelper(
bvhResult.skeleton.bones[0]
);
bvhSkeletonHelper.skeleton = bvhResult.skeleton;
scene.add(bvhResult.skeleton.bones[0]);
scene.add(bvhSkeletonHelper);
// play animation
bvhMixer = new THREE.AnimationMixer(bvhSkeletonHelper);
bvhMixer.clipAction(bvhResult.clip).play();
gltfLoader.load("Ybot BvhName.glb", function (gltf) {
const model = gltf.scene;
scene.add(model);
const skeletons = model.children[0];
// 获取模型的骨骼
var gltfSkeletonHelper = new THREE.SkeletonHelper(skeletons.children[0]);
let gltfSkeleton = new THREE.Skeleton(gltfSkeletonHelper.bones);
gltfSkeletonHelper.skeleton = gltfSkeleton;
scene.add(gltfSkeletonHelper);
let retargetedClip = SkeletonUtils.retargetClip(
gltfSkeletonHelper,
bvhSkeletonHelper,
bvhResult.clip,
{
preserveMatrix: false,
preservePosition: false,
useFirstFramePosition: true,
preserveHipPosition: false,
useTargetMatrix: true,
}
);
mixer = new THREE.AnimationMixer(gltfSkeletonHelper);
mixer.clipAction(retargetedClip).play();
});
});