next up previous
Next: Data Structures Up: How To Implement a Previous: How To Implement a

General Information

(It's a working copy, English haven't been checked, mail2 me if you will find any bugs)
We will consider an example of Soft Ball build of a two dimensional shape of material points (MP). MP are connected by a linear springs but we use connection between neighbour MP only (see figure 1). We are not using any special structural springs at all.

Figure 1: Simple two dimensional mesh.
\includegraphics[scale=0.4]{figures/ball2d.eps}

It is rather obviuos that simulation of a spring-mass (SM) model presented in the figure (1) in a gravity field will be useless. A shape will collapse and nothing interesting will happens. My goal in a pressure model is to apply one additional force into force accumulator which will keep the shape of the body to be more or less similar to initial one. That means that deformation of the body is allowed, but an energy minimum will be there where a ball looks like an initial one. What we will do is to apply a pressure force (see [1] for details) to an object. It means, physically that we consider "closed shape" without any holes which has a gas inside. So, we will pump a gas into the body and calculate three forces - gravity force, linear spring forces (body shape) and pressure force which keeps a shape of the body more or less constant. Let us describe now details of an algorithm, then I will describe details of all algorithm parts with ansi c code samples. In last section you will find full c code of working two dimensional soft body simulator.


next up previous
Next: Data Structures Up: How To Implement a Previous: How To Implement a
Maciej Matyka 2004-03-30