Hi guys!
I’m not able to add a texture on my GLTF model.
I get inspired by this repo: GitHub - devramkumardnagarajan/3d-Tshirt-design: Design Tshirt's using Three.js
and I convert the OBJ model used by the author to GLB.
The model converted to GLB:
model-1.glb (1.3 MB)
and the SVG texture:
Basically:
1 - I load my model and I center it on the stage ([Help] Loaded model placed very far away - #4 by DidoMarchet).
2 - I load my SVG with the SVGLoader and I place it on a canvas
3 - I pass this canvas as texture and I set the material:
const texture = new THREE.Texture(canvas)
texture.needsUpdate = true
texture.flipY = false
const material = new THREE.MeshPhongMaterial({ map: texture })
this.meshes.forEach((mesh) => {
mesh.material = material
})
When I render the scene the stage become white (the render “disappear”).
If I try to add the texture here https://brushhh.blogspot.com/ with the same model (in OBJ not GLB), the texture fit perfectly.
This is the OBJ version of the file:
model-1.obj (3.9 MB)
In conclusion my question is:
how can I add correctly a canvas texture on my model and make it fit on the model?
Any examples or advices are welcome
and thanks so much.
Regards,
Davide