gre / gl-react

gl-react – React library to write and compose WebGL shaders

Home Page:https://gl-react-cookbook.surge.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add example with scaled images at different positions

codekiln opened this issue · comments

Example Request: Bouncing Scaled Images

I would like to see an example of using gl-react to scale and translate images, similar to the WebGLFundamentals Bouncing Image demo. As a beginner with GLSL, it's unclear to me how to translate this into gl-react. For example, it seems like functions like m4.translation, m4.scaling would be very helpful, but I'm uncertain whether it makes sense to implement them myself in GLSL, or whether there is a way to use an existing library to get this functionality.

You can use gl-react-image for this: https://github.com/gre/gl-react-image
and the example is quite explicit: https://gl-react-image.surge.sh/