Delving into the world of Three.js, I've embarked on a project to design a 3D kit creator for my college assignment.
Through my study, I've grasped the basics of setting up scenes, scene objects, geometries, materials, and textures.
I've reached a stage where I've established a scene, imported an external geometry - a .json model from Blender, and successfully applied a simple SVG graphic as a texture.
https://i.sstatic.net/cGfHB.png
Yet, I've hit a roadblock. The challenge now is to personalize the colors of the SVG (jersey design) on the model.
My initial plan was to dynamically manipulate the HTML attributes of the mapped SVG using JavaScript.
However, I encountered some issues with this approach:
- Three.js requires models and textures to be set up within it before being displayed in the browser through a canvas element, making it difficult to access and alter SVG attributes through the browser inspector.
- The texture loader function of Three.js seems to only accept file paths as inputs instead of directly using raw SVG code.
After seeking advice, I was encouraged to explore if there are any built-in features in Three.js that allow manipulation of SVG textures or ways to manually access SVG attributes.
Despite extensively searching through resources and documentation, I haven't found a solution yet.
Which brings me to my query:
How can one access and modify the properties of an SVG graphic applied as a texture to an external geometry in Three.js?
Perhaps there's something essential that I've missed or alternate approaches that could be explored? In any case, thank you for dedicating your time to read, offer insights, and provide assistance.
Stay blessed and appreciative.