Giter Site home page Giter Site logo

Capture view as svg about gl-react HOT 4 CLOSED

gre avatar gre commented on April 28, 2024
Capture view as svg

from gl-react.

Comments (4)

gre avatar gre commented on April 28, 2024

I'm not sure to understand what you mean by "capture view as svg", right now we can capture the gl view as a PNG.

Also 3D models are currently out of scope of gl-react but discussion on supporting vertex data / vertex shader has been started: https://github.com/ProjectSeptemberInc/gl-react/issues/6

from gl-react.

 avatar commented on April 28, 2024

hey @gre
thanks for the info.

i need to do the same thing as you mentioned, capturing the gl view as a PNG, except i was hoping to capture it as SVG. SVG being a vector format.
Maybe this should be a new "want" for the issues ? Dont know what you think. With threejs its possible.. It captures everything but not texture. So its technically possible.

Regarding 3D models, it seems your using a 3d webgl canvas, but the architecture is only designed for 2D operations ? The 2D functionality is something i need, but it would be also useful to me (and maybe others) for reactive 3D functionality too. Again i guess its up to you if you want to allow this featured as a possible thing to work on going forward.

I could help with some of the work, but i would be very curious what others also feel, because its a fair bit of work.

Btw this is a really great project. I am also hoping to help with supporting feature 7 API parity between the web and native implementations.

from gl-react.

gre avatar gre commented on April 28, 2024

There is no such thing as "3d webgl canvas". WebGL is a low level API, fundamentally a 2D API, that allows you to implement incredible effects/draws and with the performance of the GPU. Of course you can do 3D with WebGL and this is what most people do with WebGL but our use-case is more wide than this:

gl-react is a thin wrapper on top of WebGL to use GL Shaders in React context and currently focus on making stack of effects. As being a thin wrapper, gl-react does not abstract WebGL so much, you have to write fragment shaders to do effects.

Also Canvas is fundamental a 2D pixels area. It is a bitmap and it is not vectorial as SVG is. Therefore I see no way to generically generate an SVG out of this.

Currently it does not implement vertex data / vertex shader which is needed for making polygons and therefore making 3D stuff. This is tracked in https://github.com/ProjectSeptemberInc/gl-react/issues/6 but it is not in our priority right now because the task is huge. Especially if we want to make it also for gl-react-native.

If you want to do more advanced 3D, I would recommend using Three.js in React, maybe via https://github.com/Izzimach/react-three . Any classical WebGL library can be used in React with a component that render() a <canvas /> (see Working with the Browser ).

from gl-react.

 avatar commented on April 28, 2024

Makes sense. Thanks for filling me in, because i was not sure.

I will have a look at react.three, as yes it does sounds like more of what i am looking for. I did not know about that one.

Closing...

from gl-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.