Can someone help me figure out how to properly load a texture for a 3D model in a ply format?
I'm working on an HTML file where I'm using three.js along with plyloader.js to load the model. However, I'm having trouble loading the texture correctly. The methods I've tried from the documentation only apply the color to the texture and not the image itself.
This is what I've been attempting:
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'm hoping to see the loaded model with the texture, but so far it's only displaying the model with the dominant color from the image.