Update canvas as a texture mapped on a meshBasicMaterial, using fabric.js #1289
-
This is the goal! https://jsfiddle.net/prisoner849/rr1bsfsj/show/ I am trying to replicate the above in react-three-fiber, currently just trying to get it working on a basic cube before moving to hopefully applying my canvas as textures to meshes/materials within GLTFJSX models. Issue is, is that right now, when I click add circle or rectangle, it appears on the cube (great!), but when I interact with the canvas(e.g click and drag, or make bigger/smaller), it is not in "realtime", I am thinking this has something to do with me not calling useFrame or needsUpdate somewhere but am just shootin' in the dark and i'm sure i'm missing something super obvious. Would LOVE for it to behave the same way as the top jsfiddle does. Any ideas what I might be missing? Would be super grateful for any and all responses! Thank you!!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Used this approach and it worked perfectly! Updated codedanboxn below! Hope this can help someone else! |
Beta Was this translation helpful? Give feedback.
SOLVED! https://spectrum.chat/react-three-fiber/general/html-canvas-as-texture~05413b03-cb63-45bb-a0fe-b78056aa7ebe
Used this approach and it worked perfectly! Updated codedanboxn below! Hope this can help someone else!
https://codesandbox.io/s/admiring-wildflower-bqv0