mod1 is a simple water simulation demo written in rust by gsmith.
It use the pipe model to store the pression between each cells of the water heigthmap.
The water height and pressure evolution run on the cpu so the map has a resolution of only 100x100 cells.
- make sure to have rust installed: https://www.rust-lang.org/tools/install
cargo build --release
to build the demo.
cargo run --release -- <mapfile>
or ./target/release/mod1 <mapfile>
, will launch the demo with the specified mapfile.
example: cargo run --release -- resources/demo1.mod1
There are multiple map file in the resources folder, you can edit them or make your own.
A map file should contain only one point per line, each point corresponding to 3 float number separated by spaces.
input | effect |
---|---|
left-click | move the camera around |
w | add water on the side of the map (wave) |
t | add water on low level terrain (tide) |
r | add rain |
d | drain water on low level terrain |
+ | increase strength of water command |
- | decrease strength of water command |