Three.js set texture to inline svg

Viewed 111

I am not sue of this is even possible but instead of setting a texture to a jpg like THREE.TextureLoader().load('./texture1.jpg')

I want to set the texture to an INLINE SVG (I want to animate with javascript GSAP).

Is this possible? Probably not :(

1 Answers

Sorry, it's not. You can't use a SVG file as a texture. However, you can load SVG files in three.js via THREE.SVGLoader and then create shape meshes from the resulting path data.

But keep in mind this is a one-time operation. If you animate the SVG, you won't see any effect after the loading process.

Related