I still haven't figured out though how to stop wave reflection at the edges though...
Simulation class: 2D wave equations (in browser)
11–14 of 14 posts
Re: Simulation class: 2D wave equations (in browser)
#12I loved playing around with this kind of water simulation when I was younger, the basic principle behind it is very simple. Spent many hours optimizing C++ and OpenGL code. I still haven't figured out though how to stop wave reflection at the edges though...
This works remarkably well; you can see this approach in action in http://www.falstad.com/ripple/ for instance. Source code is included on the page.
Re: Simulation class: 2D wave equations (in browser)
#13I loved playing around with this kind of water simulation when I was younger, the basic principle behind it is very simple. Spent many hours optimizing C++ and OpenGL code. I still haven't figured out though how to stop wave reflection at the edges though...
The trick is to perform damping around the edges in a hidden border around the heightmap. Say you wanted to simulate a 500x500 heightmap. You would actually calculate the results for a 700x700 heightmap, (which contains a hidden border of width 100 around each edge). The hidden edges are slowly damped away by multiplying by a factor interpolated between 1 (on the inner edge of the visible part of the heightmap) 0 (on…
Re: Simulation class: 2D wave equations (in browser)
#14I wondered what language it was written in and found out after a little research: http://processing.org/