To view this content, you need to install Java from java.com

Fluid Dynamics

Simple fluid dynamics sketch, based on Real-time Fluid Dynamics for Games (PDF) and Plasma Pong.

Left mouse button - click and drag to stir fluid
Right mouse button or shift key and left mouse button - click and drag to add density

Controls (click the applet first)
r key - reset
d key - show/hide density (default: show)
v key - show/hide velocity vectors (default: hide)
n key - show/hide normal vectors (default: hide)
g key - show/hide gradient colours (default: hide)
l key - add/remove 3D lighting (default: show)
+ key, - key - increase/decrease fluid viscosity

Gradients ('borrowed' from Plasma Pong)
0 key - black to white
1 key - random gradient (press for a new random gradient each time)
2 key - spectrum (rainbow colours)
3 key - 'infrared'
4 key - black body
5 key - neon
6 key - winter
7 key - summer

For smoke like effects, try gradient 6 and press l to remove 3D lighting

Source code: fluid_dynamics

Built with Processing