P5JS Simulations

Simple simulations using P5JS as the rendering engine.

Fire Simulation

Give the particles a few seconds to warm up before seeing it rise up!

Technically, I’m modelling heat transfer, and the simulator is actually showing convection cycles in heat transfer. The particles are colored from black, to red to white based on how hot they are. Hotter particles feel a greater force upwards. There exists a heat source at the center bottom of the simulator. Particles slowly lose heir heat due to radiation, they cool and fall back down. As particles turn black when cooled, and the background is also black, these cold particles aren’t visible on screen. However they do descend on both sides of the central rising column.

Code: Github

▶ Click to Play



Sand Simulator

This is a simple physics emulator. Use your left mouse button to attract the particles, right mouse button to repel the particles.

Code: Github

▶ Click to Play