hi all, i have encounter a problem when i load a bvh animation and set the animationClip for a gltf model,
the bvh animation is exported from blender, and the gltf model is also exported from blender , they are export from the same object.
I have what seems to be the exact same problem. I’m loading a character from GLTF, then applying the clip from a BVH file, and getting the same exact type of distortion.
First thought that comes to mind is that the UP axis is different for all coordinate and child coordinate systems. For example Z-up instead of Y-up.
What happens if you swap all the Y position values with Z position values in every keyframe track? For example, something like this:
new BVHLoader.load('path/to/file.bvh', (bvh) => {
const pos = new Vector3()
const posTracks = bvh.clip.tracks.filter(t => t.name.includes('.position'))
for (const track of posTracks) {
for (let i = 0, l = track.values.length / 3; i < l; i++) {
pos.set(
track.values[i * 3 + 0], // x
track.values[i * 3 + 2], // z
track.values[i * 3 + 1], // y
)
track.values[i * 3 + 0] = pos.x
track.values[i * 3 + 1] = pos.y
track.values[i * 3 + 2] = pos.z
}
}
})
For me this straightened most of the model out, except my character is bent in half after, plus the animations still don’t work.
If we change the axes for each position, I’m guessing we might also need to change the quaternions?..