Live data from Hacker News

Web GL Ocean Simulation

david.li

21–30 of 138 posts

Re: Web GL Ocean Simulation

#21
post #5

Earlier quoted context omitted.

Great demo, well written code. Though reading through it also highlights that JS is not a great language for linear algebra. But I don't think anyone is really suggesting otherwise.

"JS is not a great language for linear algebra." what does that even mean? It's a general purpose language. It all boils down to how you want to use it, like any other general purpose language. A lot of times in cases like this, people choose not to make it look pretty and easy to read to gain performance. This simulation is very CPU intensive, trying to have pretty code and speed is going to be tough.

Not only tough but ultimately impossible; like C it is nice that people can stretch JS to maximize performance - a developer can always maintain separate file with "nicely" formulated calculations but at the end of the day what matters is the end user's experience of speed in the final app.

Re: Web GL Ocean Simulation

#22

This runs at about 7 frames per second in Chrome on my 10-month-old 13" Macbook Pro at work. Are people with better graphics cards seeing 60 (or even 30) fps? I'd love to be able to see this in all its glory.

It's definitely performing better than that on my 2nd gen 13" MBP on Chrome. Could it be struggling with retina?

Re: Web GL Ocean Simulation

#23

Honestly very impressive, idea: if made into fullscreen (i.e. without edges visible) and with an added horizon and an emulated sun-rise/sun-set this would make for totally enthralling watching - the "live'ness" of it makes it a thousand times more interesting to the eye than images or pre-recorded video material.

I'd love to see that!

A dream/stretch goal would be some sort of a vessel (fishing boat?) that allowed me to recreate the 'perfect storm' and WASD around while trying stay afloat.

Re: Web GL Ocean Simulation

#24
post #5

Earlier quoted context omitted.

Great demo, well written code. Though reading through it also highlights that JS is not a great language for linear algebra. But I don't think anyone is really suggesting otherwise.

"JS is not a great language for linear algebra." what does that even mean? It's a general purpose language. It all boils down to how you want to use it, like any other general purpose language. A lot of times in cases like this, people choose not to make it look pretty and easy to read to gain performance. This simulation is very CPU intensive, trying to have pretty code and speed is going to be tough.

"what does that even mean?" "It's a general purpose language" You answered you own question.

Re: Web GL Ocean Simulation

#27

Honestly very impressive, idea: if made into fullscreen (i.e. without edges visible) and with an added horizon and an emulated sun-rise/sun-set this would make for totally enthralling watching - the "live'ness" of it makes it a thousand times more interesting to the eye than images or pre-recorded video material.

It could even pull weather data for wind speed and direction along with time of day for the suns position.
Post reply on HN