My simple and fast versio of metaballs, based more on graphics and image manipulation than 3D-maths:
We use precounted bitmap-images such as this:

Here are the channels separated,
in RGB channels we have a rendered image of a sphere,
Alpha channel is generated by the distance to image’s center

We draw some of these using bitmapData.draw:

That looks very sci-fi already,
but the final touch is to still make some more adjusting on the alpha-channel,
now looking like a X-ray shot:

We add contrast (16x) to alpha and come up with this:

… and … that’s all, there we have it, the metaball -image – click for demo* :

… and this is just the principle. It would be easy to add shadows, Z-dimension, more advanced interactivity, maybe visual effects such as glows, some kinna reflections, displacementMapFilter etc. to it…
(* fix: try Firefox, if demo looks like a thumbnail/peephole in MS-Explorer, I’ll fix that later …
Edit 12.12 2008: Check out also the pb-version of blobs for Flash Player 10.





Interesting implementation
This shadow effect looks especial cool
By: wonderwhy-er on September 10, 2008
at 1:08 pm
Hi is that actually real code with AS, or just an animation?
By: Saddist on September 19, 2008
at 8:58 pm
very interesting approach. have u ever worked with 3d imp surfaces? i was wondering, cos if u have i would very much liked to have a comment from you about my crazy thoughtts regarding meatballs..
best,
mantas.
By: maantas on October 9, 2008
at 7:21 pm
Wonderwhy-er: Thanks
Saddist: it’s the code for the whole demo, metaballs as objects in it, written with FlashDevelop.
Maantas: This is an easy solution for 2D. I’ve done like for instance some testing with metaballs by implicit surfaces with an early release of pixel bender, couldn’t get it working properly then – in full 3D – maybe some day I’ll give it a second thought.
I’ll take a look at your blog if I come up with something …
By: pixelero on October 10, 2008
at 5:57 am
hey thanks. i like the idea behind your solution “cheating”
just exactly what cg is all about 

je if u ever look in to marching cubes algorithms, have a look at my blog to
best!
m.
By: maantas on October 10, 2008
at 1:46 pm
[...] http://pixelero.wordpress.com/2008/03/04/metaballs-actionscript-30/ [...]
By: Seed-based Noise Generator | HIDIHO! on December 22, 2008
at 4:19 pm
[...] http://pixelero.wordpress.com/2008/03/04/metaballs-actionscript-30/ [...]
By: trop bien le blog » Seed-Based Noise Generator (=>fait du bruit avec ta graine) on February 25, 2009
at 7:56 pm
This works, as one can see, although, the metaballs edges aren’t… continous. This is because you use a function that isn’t continous in it’s derivative form. f(x,y) = 1 – (x*x + y*y). f’(x,y) = – 2x – 2y.
A good tip is to instead use a function which is continous in it’s derivative form. For example: f(x,y) = (1 – (x*x + y*y) / R*R) ^ 3 – c where R is the isosurface’ interaction limit and c is the shrinkwrap amount. Further one should use a constant offset value of 1/2 in order to shrinkwrap the isosurface optimally around the objects. This way your metaballs will look much smoother.
Other than that, I think this example is a very straightforward way to emulate isosurfaces!
By: Linus on September 24, 2011
at 3:02 pm