Live data from Hacker News

Two.js

jonobr1.github.io

71–80 of 92 posts

Re: Two.js

#71

Earlier quoted context omitted.

Oh and the commit from last Wednesday was three lines long

please stop trolling. I know you think you're on to something but you're really not.

How can someone who voices genuine concerns be a troll ? I was actually interested in this framework. Right now I'm torn between pixi.js and easel.js , this seemed like a viable alternative.

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.

Re: Two.js

#72

Earlier quoted context omitted.

please stop trolling. I know you think you're on to something but you're really not.

How can someone who voices genuine concerns be a troll ? I was actually interested in this framework. Right now I'm torn between pixi.js and easel.js , this seemed like a viable alternative. 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 impr…

Submit a patch or go away if you have a problem. The world doesn't owe you free software.

Re: Two.js

#73

Earlier quoted context omitted.

Maybe the autor thinks it is complete. EDIT: Oh wait, is the author in this thread? He can answer that.

It says in this thread that the library can't even draw text. That's far from complete

It can't play sound either. Nor can it send or receive email. That still doesn't mean it's not complete.

Re: Two.js

#74

Earlier quoted context omitted.

please stop trolling. I know you think you're on to something but you're really not.

How can someone who voices genuine concerns be a troll ? I was actually interested in this framework. Right now I'm torn between pixi.js and easel.js , this seemed like a viable alternative. 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 impr…

Self-entitled much? If the library doesn't suit your needs, just move on. There's no need to throw a tantrum about how a framework isn't tailored to your exact specifications, and how people aren't working hard enough so you can "invest" your oh-so-precious time in their unpaid effort.

Re: Two.js

#75
post #39

Interestingly WebGL is way slower than SVG and Canvas in this case (Chrome, rMBP): https://jonobr1.github.io/two.js/examples/particle-sandbox.h...

Yes! This is because when a shape is first created the WebGL Renderer draws the shape as a texture in Canvas2d and then uploads that texture to GL. The operations "Vertices" and "Scale" force each shape to be redrawn so there are a lot of textures being uploaded and deleted every frame this scenario. If you keep things to translation / rotation you can make the WebGL renderer push wayyyy more shapes than the other 2…

Why don't you draw directly your vertices in gl instead of create a tex ? And you could use optimisation of culling to be faster. (drawing object : front to back)

Re: Two.js

#76
post #48

Earlier quoted context omitted.

Renderer-agnostic is nice, actually, when you need to support lots of different browsers. 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 fas…

I love SVG support because it means you can render something in vector art in the browser which is also downloadable as a file by the user. Drawing stuff in the browser which is then stuck there is cute but lacks an important layer of interoperability with the rest of the computing ecosystem. So here we appear to get the best of all worlds: render to whatever is fastest in the browser but get automatic "export as SVG…

We could make an HTML-Canvas-compliant library that renders SVG.

In fact, I already enabled one: https://github.com/Automattic/node-canvas

Re: Two.js

#77
post #42

I'm looking for a library that can create a calligraphic shape (path) from a stroke path.

You can do this pretty easily with SVG, assuming your browser supports SVG, and your “caligraphic stroke” means you want the envelope of an ellipse translated along the path. Or do you need the precise bezier-curves for the stroke outline? For that you need to do some computation.

Yes, I want the second, because I want to use the outline in further computations.

It would be interesting to know how to compute the calligraphic stroke outline in terms of bezier curves from a given bezier curve.

Re: Two.js

#78
As someone using D3.js a lot (even for a puzzle game) - what is the benefit of using Two.js? Jumping between SVG and Canvas? (But then, is it worth the price of reducing possibilities to circles and squares?)

Re: Two.js

#79
post #50

Why Vector.isZero() is checking whether a vector length is smaller than 0.0001? Why this arbitrary number and not e.g. 0.00000001?

Dunno about this case, but probably because floating point arithmetic is a bitch. Try the following in Chrome's developer console: (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…

While we're here, the article you linked recommends equality comparison w.r.t. "the maximum number of possible floating-point values between the two values".

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.

Re: Two.js

#80
post #79
post #50

Earlier quoted context omitted.

Dunno about this case, but probably because floating point arithmetic is a bitch. Try the following in Chrome's developer console: (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…

While we're here, the article you linked recommends equality comparison w.r.t. "the maximum number of possible floating-point values between the two values". 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.

You can interact with binary representations of numbers in JavaScript using typed arrays – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Type....

For example, you can get an array of the bytes in a number `n` with this:

    new Uint8Array((new Float64Array([n])).buffer)
Post reply on HN