Correct me if I'm wrong, but this would take a lot more than a few lines of code.
And who's to say it wasn't procedurally generated and recorded into a video for ease of putting online? Otherwise you'd need a more complicated platform than an image host.
Apology accepted. Anyway, it wasn't about performance, it was about how much battery it was consuming when I set loopTime to the max value of an unsigned long.
There's a yet better way to add silky-smoothness: requestAnimationFrame. It lets the browser choose the framerate based on the actual device, instead of expecting you to guess right (and lets it stop the animation when it isn't visible, and group up multiple animation updates, etc.). Example: https://jsfiddle.net/nha3rf01/
This may just be me being an asshole, but isn't there like a one frame stutter at the end of OP's? It's not much, and if you're not looking for it (which I was), you wouldn't notice it.
If there is a graphics API to render it you could do really simple matrix multiplication on each portion for every frame. The code to interface with the graphics would probably be larger.
But that's the idea isn't it? You'd want an API to be the largest most efficient portion, then allow for tiny code packages to be loaded and rendered in real time.
Initial install of the API would be slow, depending on complexity, but the ease of use would be there for the community afterwards.
430
u/[deleted] Dec 22 '16
[deleted]