Two.js
jonobr1.github.io
jonobr1.github.io
I think it says a lot about Backbone that people are doing things like that. Modularity is nice.
Oh, and thumbs up for Two.js. Well done.
I'm curious, though, why they added an external dependency instead of just inlining a solution. There's a couple of good MIT licenced barebones implementations[1][2] floating around, and it's pretty straightforward to reimplement yourself in an hour or two if you prefer.
[1] https://github.com/Wolfy87/EventEmitter [2] https://github.com/hij1nx/EventEmitter2
:)
Gives me a heck of a lot more trust for the script and reason to try it out.
I was even contemplating using pixi for some experimental web-animation things (non-game related) since I didn't find any other webgl-with-canvas failover drawing APIs.
Good to see two.js filling this gap!
I don't mean to sound negative, I'm just not clear on the point.
Along these lines I've written projects in canvas only to realize later I should've written in SVG. One of the aims of two.js is to afford a canonical API for the developer. So the idea is that if you're rendering lots of particles and not doing any manipulation to individual particles, canvas or webgl will render faster than svg. Two.js aims to make it easier to test and switch around between the contexts. However, I should caveat all of this with two.js is very nascent...
Still specific to vector graphics rendering.
So not "on the contrary", but "to be exact".
Thanks for this, I'm probably going to spend some time recreating that ming-icanimate rendering system with two.js
I look forward to seeing what other performance optimizations I may be missing!
That said, I'm planning on switching to good-old DOM, the performance of SVG was underwhelming to me. Also, the lack of text-wrap.
From my gut, I'd say that the WebGL renderer is fast at rendering lots of shapes with only translation / rotation transformations applied to them. SVG is highly optimized on Webkit and handles shape morphing really well and so the SVG renderer handles that really well. Canvas sits somewhere in between the two.
This is a test of a lot of shapes morphing. It visualizes SoundCloud songs: http://jonobr1.github.io/Neuronal-Synchrony/?url=https://sou...
It may take awhile to load...
Hopefully I'm just an edge case while the project is young?
It's the fastest way to notify me without giving out my email on this thread.
Running in Chrome 26.0.1410.65 on a Macbook Pro running OS X 10.8.3
Taken from Two.js' site: Two.js is renderer agnostic enabling the same api to draw in multiple contexts: svg, canvas, and webgl.
There are many differences in addition to this, but this starts to give you an idea.
Very impressed. Great job!
This background is much of the motivation for the library.
Check out www.forecast.io to see the UI polish I'm talking about.