Monday, November 30, 2009

More progress on soft-body physics

I made a lot of progress with my soft-body physics engine.
Now the motion looks a lot more natural (if you get the settings right) and you can also do some seriously weird effects.

Now, I've made it so that points which are further away from the center of mass will be affected by more force (this is similar to real-world situations where there is usually more normal force to counterbalance external forces near the center of mass than other areas). This gives the Soft-body a 'wavy' feel.

Press any key to tone-down motion:

The 3 parameters that you can edit here are only a very small fraction of the properties that can now be modified through this engine. In this case the plant was generated such that there is a significant, linear distribution of weight from top to bottom; most of the weight is at the bottom (thus the center of mass is brought closer to the base). This makes things really wavy and it looks as if it is underwater. Each point on the shape is affected by tiny amounts of gravity, but the gravity on the shape itself was set to 0 (so that it would not fly-off the screen).

Here's a more realistic version:

The plant was drawn with a very basic engine which converts hand-drawn lines to a set of soft-body points in code. I plan to make this soft-body generator more robust after I finish the game that I'm currently working on.

No comments:

Post a Comment