falling droplet on water

I am looking for a piece of C/C++ code rendering a droplet falling onto water. May anyone help?

thanks in advance

hi :slight_smile: , i couldn’t find much c++ just a lot of pdf’s when googling

dont know if this will help

tried google with … falling water droplets on water c++ … and … water droplets c++

loads of techy stuff



also Nvidia has a good fluid simulation demo i think with code

anyway good googling


I think there is a demo of such a feature on Humus 's website.

Thanks a lot for your answers both to you…dasraiser and malik. I found the former URL but not the later, I didn’t nknew about it.

Malik can you make it more precise…The Humus website seems huge and I see no search engine…can you help?

again thaks a lot for helping.


Here it is

thanks so much…It maybe a good starting point.

I found something somehow more interesting (I think) but unfortunately it is written in pascal…I don’t know much about that language…see http://www.sulaco.co.za/opengl/water.zip it looks fine even though it is far from what I want to realize (falling droplet onto water).

Anyway I have to finalize the mathematic behind this matter…

again thanks alot for all.

If you can’t find anything that works, and you want to program it, a sinusoudal wave should do the trick.
The problem is actually programming it :wink:

For a “drop of water”, you have basically two partial differential equation models available. The 2D wave equation (think of a pond with some raindrops) and the 3D shallow water equations (think e.g. of a dambreak) both model what you want to see.

Jens Krüger’s GPGPU library (http://wwwcg.in.tum.de/Research/Publications/LinAlg) contains a demo of the 2D wave equation, and the RTFFS project (http://rtfss.sourceforge.net/) is an example of the more complex shallow water equation.

This is however only relevant for you if your app is not GPU-bound already, solving properly discretized versions of these PDEs will require at least a couple of Jacobi iterations for visual accuracy. If you can’t spare these, go for sinusodial waves and skip the “physically-based modelling” bit.

This page has about a ton of reading material, from “how to texture water” to “how to simulate”: http://vterrain.org/Water/

Thanks a lot for all and particularly dom_unido it is exactly what I am trying to do: solve PDEs. But it is quite hard. First the mesh is not easy to initialialize…;I mean the delaunay way. Moreover the physics (mathematics) behind is somehow tricky…So I think it is gonna be a long way to go.
At this time mu milestones are as follows:

  1. find good code to mesh water (thanks dom_unido maybe I find something nice there)
  2. Find a good PDE Solver…I had a look at matlab but it is useful but difficult to collect the code
  3. make this stuff run with opengl…

thanks in advance for any help wherever it comes from!

Jens’ library does exactly what you want to do. You can find more info on PDE solving over at gpgpu.org btw.

I have a slightly different question. What work can you tell me about regarding rendering of water droplets? I have some things in mind, but I’d like to know what previous work has been done.

In particular, I’m interested in fountains, water spraying from faucets, hoses, waterfalls, etc.

The simplest approach is to render each water particle as a white or blue dot. I’d like to go beyond that.