Three.js and KineticJS, save KineticJS layer to THREE.texture
-
12-12-2019 - |
Question
My question is pretty much exactly as the title states. I need to somehow convert a KineticJS layer into a ThreeJS texture so that I can apply it to a plane. I'm doing this because I need to utilize KineticJS's text manipulation abilities in my 3D scene.
I'm currently using the line
var texture = new THREE.Texture(layer.getCanvas());
To convert it to a texture, but that doesn't work at all. How would I go about doing this correctly? Would I need to set up the scene within a stage first?
La solution
You could use
toDataURL();
Then use that image as a texture .
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow