Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Jul 18, 2011 6:14 am 
Offline

Joined: Thu Jul 14, 2011 2:20 pm
Posts: 5
Hi,

I've already figured out how to read DircectX file (hat.x). I've created a hat using
Code:
SoftBody psb = SoftBodyHelpers.CreateFromTriMesh(softBodyWorldInfo, intVerBuf, intIndexBuffer);


I've also changed some parameters, as it was in Init_Bunny Demo:
Code:
               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.


Top
 Profile  
 
PostPosted: Mon Jul 18, 2011 7:12 am 
Offline
User avatar

Joined: Tue Jun 29, 2010 10:27 pm
Posts: 237
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 246 times
Top
 Profile  
 
PostPosted: Sun Jul 24, 2011 2:18 am 
Offline

Joined: Thu Dec 30, 2010 4:04 am
Posts: 23
Location: Hangzhou China
thank you very much, dphil.
It's really useful.


Top
 Profile  
 
PostPosted: Wed Jul 27, 2011 7:34 am 
Offline

Joined: Thu Jul 14, 2011 2:20 pm
Posts: 5
Thank you for SoftBodyProperties.pdf document it helped me a lot!

Kind Regards
Danny


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group