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?

Était-ce utile?

La solution

You could use

toDataURL();

Then use that image as a texture .

http://tutorials.jenkov.com/html5-canvas/todataurl.html

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top