You make a cube in exactly the same way as cloths and strings, only with another dimension
added, so I won't bother to go into too much detail here.
Of course you needn't have cubes. You can make any jelly shapes, and use them to calculate
stresses on various shapes of objects. I doubt that's how they do it in real life though.
Again, you can make a very flexible gel by connecting each point to its 26 nearest neighbours or a stiffer one by connecting to its 124 neighbours. As you can see from the number of comparisons you have to do, it can be a very slow process to calculate a gel in real time. It should be possible to calculate a small cube, say 8 by 8 by 8, in assembler using fixed point maths. I am currently writing this and should have an example up sometime.
I shan't bother to give any pseudo code here. You should be an expert on particle spring systems by now. When (if?) I have finished writing my realtime bouncing jelly, I will post my code up here. It will be in PC assembler using fixed-point maths.
In a gel with constant volume, the average distance between a particle and its neighbours needs to remain constant. So, for every particle, calculate that average, and, if it is too small, push the neighbours away a little. If it is too large, then pull them in a little.
I haven't actually tried this myself, but I am fairly confident that it will work.
I always thought it would be great if the land could sag and bend. This is where the gel comes in. You could have the land made up from a huge gel. It shouldn't be too slow to calculate since it's just in 2 dimensions. You could have a point every 16 pixels or so, and linearly texturemap polygons in between them. It would look totally awesome. A tank could drive out on a ledge only to find that it bends beneath it, tipping it into the water. Destroying the middle of a bridge would let the two halves colapse onto the ground. An explosion could shock the land, making the whole thing wobble, throwing tanks around.
I expect to see the next tank game that comes out have this feature.
Some C++ source code for an arbitary shaped gelly. It's for Watcom C++, so it may have some trouble compiling with other compilers. Good luck.