Will Troika 2D use WebGL? #205
-
Hi, I'm especially interested in a 2D data viz solution, maybe using Troika. The Troika docs for the 2D library are not up yet, and Troika's main page seems to suggest that the 2D functions will not be using WebGL under the hood:
So my question is: is 2D Troika the right tool for my use case? Will it be using WebGL? Hope this makes sense. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, thanks for writing. The troika-2d package definitely won't be the right tool, it's specifically a Canvas2D wrapper. But there's no reason you can't use troika-3d with an orthographic camera to render 2D content, in fact most of its original use cases were exactly that: 2D dataviz that needed to be WebGL accelerated. So if it were me I'd just go straight to "3D". You could use troika-3d, though honestly nowadays I'd recommend you take a look at react-three-fiber instead, it's generally easier to grasp and has a much larger community, and is more actively developed. That, like Troika, will also require you to learn Three.js and work with 3D objects on a primitive level, so if you wanted more "2d-like" primitives you could look into other libraries like Pixi.js or Two.js - not sure how well those support large numbers of points though. Good luck! |
Beta Was this translation helpful? Give feedback.
Hi, thanks for writing. The troika-2d package definitely won't be the right tool, it's specifically a Canvas2D wrapper. But there's no reason you can't use troika-3d with an orthographic camera to render 2D content, in fact most of its original use cases were exactly that: 2D dataviz that needed to be WebGL accelerated.
So if it were me I'd just go straight to "3D". You could use troika-3d, though honestly nowadays I'd recommend you take a look at react-three-fiber instead, it's generally easier to grasp and has a much larger community, and is more actively developed. That, like Troika, will also require you to learn Three.js and work with 3D objects on a primitive level, so if you wanted…