Back To Home Page  
 
CURRENTLY VIEWING
PRESSURIZED
SOFT BODY WITH LOCAL DEFORMATION
Implemented a Pressurized Soft Body model based on "Pressure Model of Soft Body Simulation" by Matyka et al, 2003. Added abiility to have local deformation by manipulating surface springs.
YEAR
TYPE
EFFORT
2008
Project
Solo
Pressurized Soft Body With Local Deformation
     + Introduction
     + Technical Details
     + Problems and Workarounds
@ Projects > Simulations
SECTION MENU
     + Stable Fluid (2008)
     + Cloth (2008)
     + Chain (2008)
     + Slinky (2008)
     + SPH2 (2008)
     + Multi-Type Collision (2008)
     + Soft Body Using Springs (2008)
     + Pressurized Soft Body (2008)

Introduction

In the game Cloud Guardian, I tried to use a Pressurized Soft Body (PSB) implementation to create the balloon (which later became a magical orb), which is the main object that the player will see and interact with. It is based on the paper “Pressure Model of Soft Body Simulation” by Matyka et al. published in SIGRAD 2003 and implemented using Microsoft XNA 2.0.

The basic idea is to pump a gas into the balloon to maintain its shape and volume. Surface springs are used to create surface tension on the skin of the balloon. Local deformation is achieved by adjusting the rest lengths of the surface springs.


Video showing the balloon in action, with local deformations

This is the first prototype of the balloon and is not the actual version used in the game due to lack of control by the player.

Back To Top Back To Top


Technical Details

Pressurized Soft Body
The mesh of the balloon is first obtained and a spring is placed at each of the polygonal edges. These springs are there to maintain the surface shape of the mesh but they are unable to maintain its volume. Thus a gas is “pumped” into the balloon so that the pressure of the air inside acts against the triangles of the mesh for it to hold its shape and volume.

The pressure is governed by the Ideal Gas Law as PV = nRT, where n is the number of moles of gas, R is the universal gas constant of 8.314, T is the temperature in Kelvin, and V is the volume of the balloon. By assuming that n and T are constant, an inversely proportional relationship between P and V is obtained. This relationship causes the balloon to retain its volume as it is interacted with external forces.

Since the force due to pressure is just another force acting on the vertices of the balloon, the standard simulation algorithm can still proceed as usual. The only extra thing to do is add the pressure forces on each vertex, as shown in the image below. The direction of the force acting on each vertex follows the face normal, while the magnitude is calculated as pressure divided by face area.

Direction of forces due to pressure acing on vertices of a quad
Direction of forces due to pressure acing on vertices of a quad

Local Deformation
The game required the player to change the shape of the balloon, thus I had to find some way to have local deformations, on top of the inflation/deflation of the entire balloon.

I predefined 6 regions on the balloon (arranged in a hexagonal fashion) where there are good topological flow of edges. Sets of bump edges and spike edges are marked manually. The rest length of these springs are increased or decreased to achieve local deformations.

Balloon with local deformations
Balloon with local deformations

Back To Top Back To Top


Problems and Workarounds

A recurring issue in physically-based simulations is that it is hard to find the right constants that will give the look that we are looking for. This phase usually involves a lot of trial and error to find the appropriate values to plug into the variables, failing which the simulation tends to move unrealistically or even “explode”.

Another problem faced was when I was trying to inflate/deflate the balloon. I tried to change a variety of attributes such as the volume of the balloon and the stiffness of the springs. These attributes tend to change the forces acting on the vertices and thus result in a different behavior in the mesh after the inflation/deflation has taken place. For example, increasing the stiffness of the springs will cause the balloon to “deflate” because the springs exert more force to pull the vertices closer together. However, this causes the balloon to vibrate faster when perturbed, which is changing the original behavior of the balloon.

After a considerable amount of testing, I found out that a stable inflation/deflation can take place by changing the rest lengths of the springs. Although not physically possible in real life, it works very well for our balloon simulation and it is the method that I used for the early prototypes of the game.

Back To Top Back To Top

 
CG:SKEELOGY
ABOUT ME
I have experience with physics simulation programming, character rigging and R&D on anatomical and deformable models. In my free time, I work on small personal projects such as casual games and tools development.
MY OTHER SITES
SUBSCRIBE TO SITE
SHARE THIS PAGE
Site best viewed with
IE 6.0+ and 1024x768+.