GithubHelp home page GithubHelp logo

xrui94 / water_terrain_simulation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gitelle-if/water_terrain_simulation

1.0 0.0 1.0 272.4 MB

💦Realtime water simulation on terrain, using OpenGL

C++ 86.08% C 0.64% Makefile 4.67% GLSL 6.71% AMPL 1.90%

water_terrain_simulation's Introduction

Water on surface

This project is about water flow simulation on terrain

screenshot

Terrain modeling 🏔

Program gets external file as first parameter that contains terrain map (map/demoX.mod). It is a series of coordinates in 3D. They define a few sparse points through which surface will imperatively go across. It can be either 2, 10 or 20 points for example (not more than 50).

map/demo2: (10000,10000,6000) (15000,10000,100) (15000,15000,4000)

IDW interpolation algorithm is used to represent a surface that goes through those points.

Water modeling 🧊

Height field based water simulation using "pipe model" The water is represented as a set of columns, water surface is described by the height of the columns. Each column connected to 4 neighbors with "virtual pipes". Program gets as an second parameter an external file containing the initial map of water heights (map/waterXXX.mod)

Basics

  • C++11
  • OpenGL 2.1
  • GLSL 1.20

Dependencies

  • glfw 3.3.2
  • glew 2.1.0
  • glm 0.9.9.5
  • sfml 2.5.1
  • boost 1.72.0

Install

git clone https://github.com/gitEllE-if/water_terrain_simulation.git waterSim
cd waterSim
make

I only tested and run this simulation on MacOS (Mojave, HighSierra, Catalina)

Usage

./mod surface_file [water_file]

example: ./mod map/demo1.mod map/water.mod

  • [ENTER] - start
  • [SPACE] - stop
  • [ASDW mouse] - camera control
  • [1] - water [2] - rain [3] - snow
  • [Z] - sound [X] - mute
  • [<] - slow [>] - fast
  • [-] - leak [+] - rise [0] - none
  • [ { arrow] - water leak at the border
  • [ } arrow] - water rise at the border
  • [p] - none water leak/rise at the border

💧water

screenshot

🌧rain

screenshot

❄️ snow

screenshot

water_terrain_simulation's People

Contributors

gitelle-if avatar

Stargazers

 avatar

Forkers

image-py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.