CPSC 4050 / 6050

Spring 2014

Representation of Blobby or Metaball Surfaces

DHH, 3/1/2011


                         
shaving cream

Shaving Cream
whipped cream

Whipped Cream

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:

soft equation.


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,

sum of f's

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

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.

rgb
                      blobs

A blobby surface from just 3 particles
chocolate

Blobby surfaces from a larger number of particles


  1. 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.