A Particle System Representation of Candle Wax.
Gary Herman & David Redkey
The Goal: Simulate melting and solidification effects of burning candles.
Wax is a challenging substance to model, because at any given time it can
be composed of both solid and liquid components that can interact with each
other. We were motivated to model wax because we feel the dripping effects
one sees in candles are really cool, and we haven't seen any good models
of this phenomenon.
The Model:
We used a particle system to model the physics of wax, and were able to get
a pretty good model of the melting phenomenon, although we were not able to
achieve our "holy grail" of the characteristic dripping behavior of wax.
Our particle system decomposes solid bodies of wax into sphere-packed
grids of particles, held roughly in place by powerful interpartical forces.
In addition to imparting forces on each other, our particles also distribute
heat to each other, in proportion to their relative temperature differences.
As particles heat up, the inter-particle forces are diminished, so particles
are able to flow more freely. As they heat up, particles eventually
break free from the sphere-packed solid structure, simulating melting.
In addition to particle-particle interactions, we introduce several external
interactions into the simulation to represent gravity, drag, the heat from
flame, and plane constraints to prevent particles from falling through the
table.
The heating effect flame is modelled simply as an inverse-square
distribution of heat centered at the center of the flame. Drag, a
force proportional to particle velocity but in the opposite direction,
is introduced to account for friction, air-resistance etc. It is
needed to prevent the solid from oscillating, since the force-field we
set up is conservative. It also serves to ensure that dripping
particles eventually come to rest as they cool. We also throw in a
"stochastic" force intended only to break up symmetry in the
animation.
Implementation:
We created our models with an automated sphere-packing algorithm that fills
up volumes of space with particles, given a bounding-box and a function that
computes whether a point is contained within the volume. It didn't occur to
us until later in the project that there are several non-isomorphic ways to
pack spheres and that ours was not the most symmetric.
Once the model was created, our implementation consisted of a basic
interation loop that:
- Computes the net force on each particle.
- Computes the total heat transfer to each particle.
- Updates position and velocity of each particle based on the net force.
- Adjusts the height of the flame to reflect the burning of the candle.
Since the number of interpartical interaction is O(N^2), we introduced
a uniform spatial-partitioning algorithm that limits interactions to O(N).
The partitioning had the side-effect of making the algorithm more efficiently
parallelizable by allowing a decomposition of the workload based on spatial
locality. Unfortunately, we couldn't really take advantage of this because
of time constraints, particularly due to the slowness of our rendering
technique.
Rendering:
We rendered our models using Bill Gates' favorite modeller, SoftImage 3D.
We needed to somehow come up with a scheme that made our discretized
particles look like smooth solids and liquids. We chose metaballs, because
of their ability to merge together to form smooth iso-surfaces. From a
modelling standpoint this worked pretty well, although it proved extremely
difficult to capture the true nature of our bounding analytical surfaces.
Usually, resulting surfaces were still somewhat lumpy where we wanted them
to be regular and smooth.
Since we wanted the material properties of liquid and solid particles to be
different, yet we wanted the liquid particles to merge somewhat with the
solid particles, we created two metaball systems. One system included all
the particles and had the material properties of the liquid, and one included
only the solid particles, had the material properties of the solid, and
was just slightly larger than the other model. The second
system was slightly larger so no one could see the solid particles drawn as
liquid.
We faced two big hurdles with our efforts in this area. First of all, it
took a lot of work to get properly integrated with SoftImage and Mental Ray,
it's add-on ray tracer. Secondly, ray-tracing our metaball scenes was
extremely time-consuming due to the fact that SoftImage chops metaball
systems into polygons before rendering and a high density of polygons are
required for smooth looking images. The severely limited the number of
particles in our simulation to ahundred or so.
Conclusions:
We were able to create solids that could fall, bounce, and melt, but realistic
dripping behavior was hard to obtain. Particles proved very difficult to
control, especially since the discrete model produced "surfaces" that were
so lumpy. When particles gathered enough momentum to escape the attraction
at the top of the candle, they had a tendency to either get stuck again or
fly away from the candle. We were pleased that the simulation itself was
reasonably fast, but the rendering times were substantially slower than we
had hoped.
Bibliography:
"Modelling Liquids and Solids using Thermal Particles",
Graphics Interface '91
David Tonnesen
"Heating and Melting Deformable Models(From Goop to Glop)",
Graphics Interface '89
Dimitri Terzopoulos, et al
Globular Dynamics: A Connected Particle System For Animating Viscous
Fluids
Computers & Graphics Vol. 13, No 3, 1989
Gavin Miller and Andrew Pearce