Cartoon Liquid Simulation

Update June 2013: This program has been ported to WebGL!!!

The other day I came across this neat visual trick: How to simulate liquid (Flash). It’s a really simple way to simulate some natural-looking liquid.

I [made my own version][fun] in Java, using JBox2D for the physics simulation.

For those of you who don’t want to run a Java applet, here’s a video demonstration. Gravity is reversed every few seconds, causing the liquid to slosh up and down over and over. The two triangles on the sides help mix things up a bit. The video flips through the different components of the animation.

null program

Chris Wellons