   Ragdoll generation from skeleton
  I have several meshes that use skinning. They have skeleton, bone indices and weights. It's working like a charm when playing animations, but I have a problem when I want to change them into ragdoll.This is a skeletonhttp://img32.imageshack.us/img32/4007/skeletonq.jpgYou can't see separate bones, but for example spinal cord is made from several bones (to allow smooth animations). This is cool when playing animations but a huge problem with ragdolls.I generate ragdoll (capsules) from bones and get this:http://img263.imageshack.us/img263/2817/ragdoll.jpgAs you can imagine, it's nowhere near the original mesh.What can I do except use different skeleton (it would require separate mesh VBO for ragdoll)? I wanted to read joints angles between bones to calculate back bones positions.   
  I'm not sure what the question is. Do you want your ragdoll capsules to look like your original mesh? What is the purpose of having the capsules look like the original mesh?Or is your issue that you generate too many capsules for the spine?   ;  I'm not sure where your issue is... I think I see two things you think you want, just correct us if I'm wrong.1. You're generating a collision mesh for the ragdoll based on capsules on the skeleton. Solution; just use your existing collision mesh from your full model, if any. Or create one, if you don't.2. You're experiencing too floppy a ragdoll because your animation skeleton has too many bones. Solution; as you said: make your ragdoll skeleton out of fewer bones (say, two spine bones instead of six, and reduce hand bones to three instead of eleven). Generate new skinning weights for your mesh to suit this lower-resolution skeleton.   ;Quote:Original post by Wyrframe2. You're experiencing too floppy a ragdoll because your animation skeleton has too many bones. Solution; as you said: make your ragdoll skeleton out of fewer bones (say, two spine bones instead of six, and reduce hand bones to three instead of eleven). Generate new skinning weights for your mesh to suit this lower-resolution skeleton.He could also look into using stricter constraints with the spine bones. Although it would be much more efficient to do as you said and lower the bone count.   ;Quote:Original post by WyrframeI'm not sure where your issue is... I think I see two things you think you want, just correct us if I'm wrong.1. You're generating a collision mesh for the ragdoll based on capsules on the skeleton. Solution; just use your existing collision mesh from your full model, if any. Or create one, if you don't.2. You're experiencing too floppy a ragdoll because your animation skeleton has too many bones. Solution; as you said: make your ragdoll skeleton out of fewer bones (say, two spine bones instead of six, and reduce hand bones to three instead of eleven). Generate new skinning weights for your mesh to suit this lower-resolution skeleton.I would like to avoid generating separate mesh/skeleton/weights set for ragdoll as it would not only double memory usage but also removed ability to blend between prerendered animations and ragdoll.I can tune generated capsules heights & radiuses (so that I can for example align arms capsules to mesh) but of course I can't set radius > height/2 so there is no way I could make spine bones thick enough to cover torso. As you say, the best I could do is reduce bones count in spine section to 1-2. This is no problem with physics, but how can I drive skeleton (graphics) animations with fewer bones that in base skeleton? And it applies in second side: how can I drive physical bones (capsules & joints) from prerendered animations when bones doesn't match? For example 6 bones in GFX skeleton animation, 2 bones in ragdoll. Character bends so that spine creates a curve -- how can I model this in ragdoll body (which I would like to use also as collision mesh)?   ;Quote:Original post by John Nash but of course I can't set radius > height/2 so there is no way I could make spine bones thick enough to cover torso. Use filleted boxes, or just boxes.Quote:As you say, the best I could do is reduce bones count in spine section to 1-2. This is no problem with physics, but how can I drive skeleton (graphics) animations with fewer bones that in base skeleton? And it applies in second side: how can I drive physical bones (capsules & joints) from prerendered animations when bones doesn't match? For example 6 bones in GFX skeleton animation, 2 bones in ragdoll. Character bends so that spine creates a curve -- how can I model this in ragdoll body (which I would like to use also as collision mesh)?This part is tricky. You have a collection of undriven bones in the GFX rig. You need to compute their orientations. Say you have 3 GFX spines and 1 ragdoll spine.In the bind pose, the ragdoll spine will go from the pelvic to the head location, and may be a relatively poor representation of the spine, but that's ok, it's a video game.When you apply the ragdoll orientations to the GFX, you'll compute the new spine1 orienation and leave spine2 and spine3 in their bind pose or in the last animation pose when ragdoll was activated.It's just a bit of linear algebra.Hopefully this gives you some ideas for driving the ragdoll rig which has less bones than the animation (the sum of the GFX spine bones is what will drive the single ragdoll bone)