I'm trying to show a 3d model with its respective texture, how could I load the texture for a ply model?
this is in an html file where I use three.js with the plyloader.js to load the model, but I have not managed to load the texture correctly, when I try to load it with the methods I found in the documentation it only loads the color to the texture but not the image.
I'm trying this:
var loader = new THREE.PLYLoader();
loader.load('head3d.ply', function (geometry) {
geometry.computeVertexNormals();
var texture = new THREE.TextureLoader().load('head3d.jpg');
var material = new THREE.MeshStandardMaterial({ map: texture, flatShading: true });
var mesh = new THREE.Mesh(geometry, material);
mesh.position.x = 0;
mesh.position.y = 0;
mesh.position.z = 0;
mesh.scale.multiplyScalar(0.006);
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
});
I hope you show me the model loaded with the texture but only shows me the model with the color that dominates the image