

Real-time browser-based modelling of 1- and 2D waves - maxime1008
http://ttsiodras.github.io/physics.html

======
Jare
Cool! That's the math we used in 1994 for the watery stuff in the beginning
and end of our demo Heartquake.

[http://www.youtube.com/watch?v=q9_VUDz_tuM](http://www.youtube.com/watch?v=q9_VUDz_tuM)

For the oldschool among us, the source code for the end credits, in venerable
Turbo Pascal, can be found at
ftp://ftp.scene.org/mirrors/hornet/code/effects/water/hq_water.zip (it may be
detected as a virus threat because executables inside were compressed - don't
try to run them). Arturo wrote an in depth explanation of the physics and math
behind it (he was wrapping up his MS in Physics) but I have no idea where to
find that anymore.

------
jessaustin
UI thoughts:

I don't have a good intuition of what the multiple strings are supposed to
mean. Perhaps I'm seeing a bug because the initial "pull" seems to come from
the bottom of the screen instead of the middle.

The 2D water wave should be displayed with more contrast. I can see a vague
movement, but the peaks and troughs mostly just blend in with the rest of the
water.

~~~
ttsiodras
It's not a bug; it's a feature :-)

The code "pulls" the middle sample down, to the bottom of the window, and then
the simulation runs.

As for the 2D simulation, you were right - I just pushed a version with more
contrast.

Thanks for the feedback!

~~~
jessaustin
Still, what do the multiple strings mean? I was expecting a single string with
a complex waveform, with additional pulls changing that waveform. Instead I
have a new string every time I pull.

~~~
ttsiodras
> I was expecting a single string with a complex waveform, with additional
> pulls changing that waveform

Actually, that's exactly what you are seeing - by pulling the middle sample
down to the bottom every time you click, the "spring-like" pull of the sample
to the left and the sample to the right (see the Theory section) trigger
additional waves that propagate, reflect on the walls, and interfere with the
original one.

