Hacker News new | past | comments | ask | show | jobs | submit login
Real-time browser-based modelling of 1- and 2D waves (ttsiodras.github.io)
5 points by maxime1008 on Dec 4, 2013 | hide | past | favorite | 5 comments



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

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.


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.


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!


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.


> 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: