Fluid Simulator - Google's Liquidfun
mwilki7 (784)

I searched everywhere for sample javascript code for this (based on Box2D which is a C++ library) and finally found something functional.

The only things I added were html controls for the objects.

Most of it is based off of https://github.com/doebi/liquidfun.js-demo/tree/master

If you want faster framerate, shrink your window.


• B : Create physics box
• W : Create blob of fluid
• Left mouse: Create Blob of Fluid
• Right mouse: Create frozen box
• Middle mouse: Create physics box
You are viewing a single comment. View All
mwilki7 (784)

if anyone could tell me how to change the darn fluid color that would be rly nice

TaylorLiang (634)

@mwilki7 in the let current color variable, change the R G and B values.

mwilki7 (784)

sadly ive tried all sorts of combinations of stuff so far
i can change the color of the boxes but not the fluid

even commenting out the line: pgd.set_color(color); doesn't change the color
i think me mind is going ded