Forum

Water simulation: using native JavaScript or C++ and Emscripten?

30 December 2016 22:19
Hi all,

Hope you are all having a great holiday season!

I am remaking an App I wrote when I was still at college when I was 17 in my Physics class. It was a simulation of a water surface, subdivided into a grid of squares. On this grid I applied the wave equation which would simulate the water surface.

Now I want to make this in Blend4Web… however, in your great experience (better than mine), would it be best to write the algorithm in C++ and convert to JavaScript using Emscripten or use direct JavaScript?

This is because I have no idea what would be more efficient!

Thanks!

Andrew

PS. I noticed that uranium uses C++ and Emscripten inside the Blend4Web code!
PS. Is there a way to change my email address associated with my Blend4Web account? I think that I'm not getting emails because I changed my email account.
02 January 2017 00:30
Hi, and Happy New Year!

Yes, Blend4Web uses Emscripten. Actually, it already has water simulated with C++ converted to asm js. It works when you turn on the Water flag on the material, and use some objects with Floater physics. So, if you are going to implement your own model, choosing C++ sounds like a good idea
Blend4Web developer
03 January 2017 01:10
Thanks!
 
Please register or log in to leave a reply.