There is an
interesting approach in computer graphics that can be used to
model a
number of "blobby" materials, like the shaving
cream and whipped cream in the figures above. The idea is to model
the
volume contained by the material by a collection of particles.
Each
particle is the center of a "field" function that typically starts
at 1
at the particle's location and goes to zero at some distance R from the particle. An
example is
the "soft object" equation for the field around a particle i at distance ri
from the particle:
.
Now,
if
we have a collection of particles, some of which are within
distance R of each
other, then their fields
overlap. We can, therefore, define a total field function by
summing
over all of the particles at some spatial point x,
Position xi
denotes the
location of particle i.
This
field function gives us a measure of how near the point x
in space is to
one or more particles in the collection. If we form the
level set
,
where L is some arbitrary
scalar value,
then we have a function that goes to zero exactly when the
total field
effect from the collection of particles sums to exactly L at point x
in space. When
rendered as a surface, this turns out to be a fairly
pleasing blobby
looking surface. Its look can be adjusted by tuning the L value being used
and by moving
the particles around. The two images below are simple
examples.
A blobby
surface from just 3 particles
Blobby
surfaces from a larger number of particles
Given
the
scheme described above, and a particular choice of L, think about
the simplest way
you can think of to make an image of the "blobby"
surface described by
a set of particles. Assume that you already have a
nice spatial data
structure so that whatever calculations you have to do
are efficient.