PDA

View Full Version : 11.5 Soft Body Dynamics - Waving Flag



tcoursey
02-21-2013, 02:44 PM
So I'm a bit confused possibly. Is the new Soft Body dynamics to replace or mimic the old cloth dynamics? I am wanting to make a waving flag with the new soft body dynamics but I'm not getting very far yet.

Anyone with some thoughts or tutorials?

Am I off base trying to use "soft body" bullet as cloth?

UnCommonGrafx
02-21-2013, 04:04 PM
Softbody works.
I was messing about with it today but got it wrong.

Some how, you have to have some piece that is hard, per se, and another that is soft.
http://www.youtube.com/watch?v=iAJzZ00La6Q
At 19:55, Lino is speaking to this; you may want to back up a bit. Very doable and very easy.

Spinland
03-05-2013, 09:14 AM
That's very interesting, but doesn't (to my view) explain how the waving flag effect is achieved. I tried something last night with very poor results. I could sort of simulate a straight line wind using the "force field" attached to a null, but I didn't see anything for "turbulence" like the wind effect has. The cloth object just stretched out in the direction of the force with no flapping effect at all. "Vortex" just spins things around and isn't very useful for a flag.

I also ran into issues with the soft object stretching way too far with nontrivial force applied, and fiddling with the values didn't seem to mitigate it much. I also had the whole soft body moving in the direction of the force even though I had a row of vertices along the leading edge at zero value for the associated weight map. Maybe you have to use a bone to anchor the edge in space like you can with "fix" in ClothFX?

erikals
03-05-2013, 09:54 AM
older ClothFX test >

Lightwave test - Flag Animation
http://www.youtube.com/watch?v=jfFEr1koRlk

Spinland
03-05-2013, 10:08 AM
Thanks, erikals. I actually used the ClothFX easily enough (apart from one initial misunderstanding about how to save the motions); I was just curious whether the new Bullet Dynamics could do the same effect. Lino mentions "turbulence" in that demo video, for example, but I couldn't find that force setting.

Spinland
03-05-2013, 10:35 AM
I think I have it figured out. For the turbulence use a second force field and a turbulence procedural for the direction of the force. The attached files need some tweaking to look better but I think it's a pretty good start at doing a flapping scarf using Bullet.

Anyone want to play with this some and see if you can improve it?

Spinland
03-05-2013, 11:38 AM
I went ahead and did some more tweaking of various parameters and ended up with this. It uses the same .lwo as the above posted one. The main thing that I don't like is the turbulence seems to damp down over time instead of introducing chaotic energy the whole simulation. Does anyone else notice this?

Hieron
03-05-2013, 11:55 AM
Sure hope ClothFX is not considered as being replaced yet. Quite a few things do not seem possible with Bullet soft dynamics atm..

Such as:http://www.nymus3d.nl/player2.php?id=38&lan=en
(cells moving, pushing and dividing)

Sadly, ClothFX has not been updated in ages and does have shortcomings that could use some attention..

Spinland
03-05-2013, 12:40 PM
I agree that ClothFX shouldn't go away any time soon. Between the two versions of my flapping scarf experiment I think I prefer the results using Cloth over those from Bullet. Maybe there's a better way to simulate wind buffeting than the route I took, but barring that I think the legacy wind dynamics just work better for these kinds of applications.

I'm more than ready to be shown my errors by someone who really groks the Bullet forces.

Spinland
03-05-2013, 02:49 PM
Well, had some extra play time this afternoon so made some more tweaks. I think this version actually came out pretty well. In this test animation I rotated the straight line force field null through plus/minus 80 degrees on heading to make sure the wind was fully controllable. I left the turbulence null static as its facing really shouldn't matter.


http://youtu.be/u9fiPqYpY0Y

XswampyX
03-05-2013, 03:51 PM
Look quite good Spinland, but it's a bit stretchy. Try UVing a texture on it and you will see how it stretches more where the points are fixed.


http://youtu.be/a5UzeBQdE6E

Here's mine using the forcefield dynamic.

OnlineRender
03-05-2013, 05:34 PM
ill stick with the old cloth for now , seem to work well enough , rig test part

http://youtu.be/k7VCYpxewXA

Spinland
03-05-2013, 06:24 PM
Look quite good Spinland, but it's a bit stretchy. Try UVing a texture on it and you will see how it stretches more where the points are fixed.

Here's mine using the forcefield dynamic.

Yeah, I still haven't figured out the parameter combination to tighten up the stretching without making the cloth so stiff it doesn't ripple enough. Any insights? I'm still puzzling this out trial and error as I go.

The flag looks great!

Thanks!

Danner
03-06-2013, 01:48 AM
Odly enough I had to to this today for a job.
This is what I came up with.
112235

Spinland
03-06-2013, 07:56 AM
Thanks for sharing that, Danner! If you don't mind, it raised a question or two for me:

How do the hold nulls interact with the deforming bodies? I saw you had a "hold" weight map defined for the flags, but can't see where that's being used, nor could I find how the nulls actually exert influence on the deformers. Are they somehow linked to the weight maps?

I'm still struggling through how all this works together so insights like these are invaluable.

Thanks again!

Danner
03-06-2013, 11:08 AM
The weight maps were not used, they are legacy from a failed test of using weight maps. The hold nulls are applied using the gradient, I'ts confusing because It doesn't work as expected, the gradient seems to apply binary glue to the nulls (on or off) I moved them out of the way so they only hold the flag by the edge. The funny thing is that all nulls affect all flags, but just one is assigned using the gradient, maybe it's because they are clones.
By the way one of the flags has self collition on. I recommend anyone testing this scene to turn it off. It calculates way faster with it off.

Spinland
03-06-2013, 01:28 PM
Well, worked out another iteration of the blowing scarf effect. I took to heart Swampy's note about the stretching, and thanks to Danner's example I was able to simplify my forces rig. By controlling the strength of the wind force with procedural turbulence and keeping the direction vector constant I was able to get away with just one velocity force object instead of the two I was using before.

I experimented with hold nulls but was never happy with how they were working for me so I went back to using a weight map to define the deforming geometry versus what stayed fixed.

In this sequence the scarf is moving 60 meters over 400 frames, simulating being worn by a skier, then suddenly stops--ouch, bad tree! Since the force was controlled by a texture I couldn't envelope it but by applying envelopes to the force density and the damping coefficient I could simulate the wind suddenly stopping. Might still need to tweak the final falling limp part to be less floaty but in general I'm happy with this approach.

Many thanks for the inputs!


http://youtu.be/P6-a1egFRSU