Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Marko Dokic, posted on August 17, 2000

Image Description, by Marko Dokic

my little opengl metaballs demo. as i started this, it looked very much like paul bourkes code. means, the values were computed for the whole grid (example: 32x32x32 times getting distance to all the balls), and all triangles used there own vertices. then i implemented a bounding box, so only the values in the box around the ball were computed. this was a large speedup, but it also brought problems, when the balls connected or there were all near eachother, the surface could go out of the box, and gaps appeared. the next thing i did was vertex sharing, because all the vertices were computed twice!! yesterday i coded that it computes the values recursively. that means that it startes with a cell, then looks what edges of it are cut by the surface, and then goes to the cells that use this edge. so only the needed values are computed. this meant over 100% speedup! you can set the grid-resolution, the number of balls, the iso-value of the surface, at runtime. i also did 6 presets of some cool settings. i realesed the source for the old bound-box version. get it at

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

August 17, 2000, 05:56 AM

Top work.... very tidy work...

I award you a Masters Degree in SHC.

(that's Very Hot Coding, for people who arent sitting in my oh-so-boring java coding laboratory atm)

fine effort

Kill the waaaabbit! Kill the Waaaabbit!

Graham Clemo

August 17, 2000, 06:31 AM

Nice work - I'd love to see it animated!


August 17, 2000, 10:08 AM

Nice environment mapping!

What framerate are you getting with the LOD setting you used for the shots?


August 17, 2000, 02:20 PM

you can get the demo these pics where made (press F12) with from my page. it's animated ;)

z80: hmm, dunno, i just played around, looking for nice shots, didnt look/remember the fps. but i'd say it varied between 1.6 (preset 6) and 100+ fps =) (p3 500, tnt2, 128 ram)

zed zeek

August 17, 2000, 06:09 PM

very nice realistic demo mate just wondering were there any keys to alter things eg speed , wireframe


August 17, 2000, 07:23 PM

Looking hot dude, very slick.

Does anyone know of any way to do metaballs in realtime? Perhaps calculating a few points on the surface to connect bezier curves in the camera space? If so, can someone point me in the right direction.


"Blessed are the cheese makers..." - Life of Brian

Alex D'Angelo

August 18, 2000, 12:05 AM

Marko: Great looking demo!

DragonWorx: The demoscene has been doing it in realtime forever, and I know Serious Sam has them in-game in the test demo. Brian Sharp recently wrote some articles on programming 3d metaballs for Game Developer and he's got the source at his site --


August 18, 2000, 12:49 AM


I think the technique explained in this paper is worth checking out if you are interested in modeling real-time implicit surfaces.



August 18, 2000, 01:11 AM

Alex D'Angelo,

Thanks heaps.


"Blessed are the cheese makers..." - Life of Brian

Graham Clemo

August 18, 2000, 04:39 AM

Does it work under NT? I get a "Failed to change to desired settings" window. (I have an NVidia GeForce card)

This thread contains 10 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.