Soft body is too soft - seting stiffness

Post Reply
s410i
Posts: 5
Joined: Thu Jul 14, 2011 2:20 pm

Soft body is too soft - seting stiffness

Post by s410i »

Hi,

I've already figured out how to read DircectX file (hat.x). I've created a hat using

Code: Select all

SoftBody psb = SoftBodyHelpers.CreateFromTriMesh(softBodyWorldInfo, intVerBuf, intIndexBuffer);
I've also changed some parameters, as it was in Init_Bunny Demo:

Code: Select all

               psb.GenerateBendingConstraints(2);
               psb.Cfg.PIterations = 2;
               psb.RandomizeConstraints();
               psb.Scale(new Vector3(10, 10, 10));
               psb.SetTotalMass(50, true);
But the model is still soft, at when it collides with ground it falls apart.
I want it to bounce, just like bunny or torus in SoftDemo app.
And I don't want it to destroy.

This is what happens:
http://imageshack.us/photo/my-images/546/hatd.png

Thanks for all help.
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm
Contact:

Re: Soft body is too soft

Post by dphil »

There are a number of things you can do. Increase the bending constraint distance. For example, psb.generateBendingConstraints(5). Basically, that is the link traversal distance to which cross-links are attached. For large, high resolution models, you need a larger value for structural integrity. Second, try reducing the mass (setTotalMass...). The nodes might be too heavy for the links to support their weight. Finally, for closed meshes (like the bunny and torus), you can use internal pressure (via the kPR constant), pose matching and volume matching, which all - in various ways - attempt to preserve the structure of an object. However, for something like a hat, I'd recommend first trying the bending constraint distance and mass, then setPose. Pressure is good for more of an organic, wobbly balloon look/feel.

Soft bodies can be a bit tricky to sort out. Attached is a rough list of bits of info I've found about the various settings (mostly in softBody.m_cfg and softBody.m_materials), in case it helps.

EDIT: I should probably note that I am still a bit fuzzy on using pose and volume matching, so take the notes on those (including those in the bottom right) in the attached file with a grain of salt.
Attachments
Soft Body properties.zip
(21.81 KiB) Downloaded 1014 times
lemonriver
Posts: 23
Joined: Thu Dec 30, 2010 4:04 am
Location: Hangzhou China

Re: Soft body is too soft - seting stiffness

Post by lemonriver »

thank you very much, dphil.
It's really useful.
s410i
Posts: 5
Joined: Thu Jul 14, 2011 2:20 pm

Re: Soft body is too soft - seting stiffness

Post by s410i »

Thank you for SoftBodyProperties.pdf document it helped me a lot!

Kind Regards
Danny
Post Reply