Two.js(jonobr1.github.io) |
Is this oriented towards gaming or substitude something like d3.js or is it has a simplier api, for the developer than other libraries. Or is it a library to showcase the cool stuff that can be done with new technologies.
I think the main difference and the selling point is that it is "renderer agnostic" but I don't understand the benefits of that.
Some mobile browsers can't do WebGL as fast as they do Canvas, for instance. Other browsers will have a huge speed advantage with WebGL.
I'm not sure if any are faster with SVG, or the relative performance between SVG and canvas. But being able to do some test renders quickly in all three modes should allow you to select the fastest for a particular browser.
Game developers are better off with a game-oriented library, IMO. Even if you used something like Two.JS to do your rendering, there are a lot of things still useful in a game library to justify using it -- and most games will need more than geometric figures.
A while back I used Choc (http://www.fullstack.io/choc/) to teach JavaScript to a high school class. A lot of Two's competitors have APIs that take into account things like performance and extensibility, but are harder to explain because of it. It was great to have a simple API that got out of the way and allowed me to teach things like if statements, for loops and functions.
Example: makemake.io (although PIXI.js is used in this case)
I'm currently developing a way to "cache" textures that don't change much so if you had a Two.Group that doesn't change much you can turn that into 1 texture. This will greatly increase performance as well. Thanks for checking it out!
#themoreyouknow
I've found the portability to be fantastic. For instance http://patatap.com runs svg on iOS and canvas on Android. Two.js makes it simple to run either on the fly.
EDIT: Oh wait, is the author in this thread? He can answer that.
The project Anitype dynamically creates and stores gifs of Two.js scenes: http://anitype.com/entries
(0.3 - 0.1 - 0.1 - 0.1) === 0.0
> false
0.3 - 0.1 - 0.1 - 0.1
> -2.7755575615628914e-17
In order to get helpful results, we're gonna have to pick some semi-arbitrary epsilon. Still, my problem domain might require a different epsilon than they expect; even if they have a default, the API should allow me to specify my own choice of epsilon.They might also want to consider being more nuanced for the equals method than just taking the difference and comparing to zero. See http://floating-point-gui.de/errors/comparison/
Any idea on how to go about this in JavaScript? The binary representation of the float isn't as easy to come by (compared to C, for example), but I wonder if you couldn't get a decent approximation with Math.log2.
Or do you need the precise bezier-curves for the stroke outline? For that you need to do some computation.
It would be interesting to know how to compute the calligraphic stroke outline in terms of bezier curves from a given bezier curve.
It's not 100% a bad thing though.
Though admittedly the pace at which this happens in the JS world can be exhausting.
Some projects that use just animated 2D:
+ http://patatap.com/ + http://anitype.com/ + http://tether.plaid.co.uk/ (broken, sorry!) + http://vr.chromeexperiments.com
Interface stuff:
+ http://justareflektor.com/tech + https://dl.dropboxusercontent.com/u/1595444/experiments/anim...
These projects have had multi-million uniques throughout their existence. 3 other large scale projects coming out later this year that use Two.js..! And these are projects just made by me :P
Maybe the author could utilize some npm modules to enable this. https://github.com/mattdesl/text-modules
For example, you can get an array of the bytes in a number `n` with this:
new Uint8Array((new Float64Array([n])).buffer)In fact, I already enabled one: https://github.com/Automattic/node-canvas
Half the links are dead now. This is the openjdk Stroker.java code: http://grepcode.com/file/repository.grepcode.com/java/root/j...
Step 2: Someone posts it on Hacker News.
Step 3: Project is immediately derided because other people have also been making new things.
But trying pin and dismiss the intention behind someone's open source project would be uncalled for, wouldn't it.
But before I start to invest time in a technology, I want to know if it's still alive.
This project is definitely not finished (text rendering), far from polished (slow webgl implementation, see this thread) and has not been improved in half a year.
Take a look at this: https://github.com/jonobr1/two.js/graphs/contributors
The whole thing was a one-man stunt and is obviously dead.
Oh, and saying "I work on the dev branch" when the dev branch is just as abandoned as the rest of the code is a blatant lie. https://github.com/jonobr1/two.js/commits/dev
Sorry, but stuff like this just makes me angry. The javascript world is full of throwaway projects that die after a few months/years. At the same time there are true gems with really elegant code. Easel, Pixi, SnapSvg, they are amazing. Advertisement for a project like this is unfair and spreads confusion.
If you need help, if you look for contributors, just say so. But don't pretend that your code is alive when it's actually cold legacy code.
There's a difference between "solid" and "moribund".