SAND POWDER SIMULATION

Github

Milestones

Basic Implementation

Pixels fall down on mouse click.

Sand Topples

Sand particle towers that get too tall topple over.

Other Materials

Add stone and water materials.

Wind Vectors

A wind vector array that affects sand.

Blog Posts

First Implementation

Posted on 21 Nov, 2024

Learning a new package called RayLib which is a package for graphics in C. Pretty insane what can be achieved with it and how easy it is to get started. Using this, I visualised a 2D array which was used as the simulation environment. An integer of 1 represents a 'sand' cell which always moves, or should I say falls, to the bottom of the array. Mouse clicks update the cell at the corresponding coordinates and you can see the sand fall down on the screen. Very simple implementation but alot can be improved, i.e. sand towers topple when too high, different materials types that either don't fall or act like liquids. I have seen others online that have fully implemented atmospheres with "wind" vector arrays which seems like a potential long term goal.