Blender Mesh + RapierJs Colliders results in weird mesh issues

Hi everyone,

I’ve created a small demo for making ragdolls with a blender mesh and rapierjs. However I am having an issue where the mesh seems to be scaled in a weird way that I cant find the cause of.

I have the following armature & Mesh in blender:

but when I activate the colliders to sync the mesh it ends up looking like this:

This leads me to think that the arm colliders are in the wrong orientation due to the weird looking mesh. However also the scaling of the mesh is off completely.

What i’ve tried so far:

  • Check normals in blender
  • Orient the bones in blender
  • Rotate the rapierjs colliders initially to apply a 90C offset in +/- to see if it fixes

Has anyone had any similar issues applying rapierjs collider data to bone positions in threejs? Code + Blender file can be found here: rapierjs-ragdoll/src/Ragdoll.ts at 2dd492a0fc8e19d8e3473fe074d00e9f97fff195 · mattvb91/rapierjs-ragdoll · GitHub

Would appreciate any pointers.

The main pointer I can give is that this is a super finicky process, and full of nightmare fuel style bugs.
I ended up writing a whole rigid body exporter for blender to get my ragdolls to match up.. at least then I could do set it up in blender and test it there first before importing.

but for doing it in purely threejs I would say:
pause your simulation, and make sure that the cubes+bones are lined up perfectly first.. scale/adjust the skinnedmesh until it is lined up. (You may have to adjust your ragdoll rig too.)
Then on each rigidbody box, use .attach( to bind its corresponding skinnedmesh bone to it.

1 Like

haha yup its definitely been finicky to get to this point. Thank you very much for the pointers will take a look and report back if I have any success

1 Like