I’m trying to load a PLY file with multiple PNG textures. I’m able to load the PLY with one texture, but fail to do so in the case of multiple texture files. When I execute the code, I don’t see any geometry and I don’t receive any errors in the console. I know where the mesh should arrive in the scene…
const textureLoader = new THREE.TextureLoader();
const plyMaterial = [
new THREE.MeshBasicMaterial({map: textureLoader.load('models/Wall_u1_v1.png') }),
... (14 PNG textures in total)
new THREE.MeshBasicMaterial({map: textureLoader.load('models/Wall_u4_v3.png') }),
];
const loader = new THREE.PLYLoader();
loader.load(
pathToPLY,
function ( plyGeometry ) {
var plyMesh = new THREE.Mesh ( plyGeometry, plyMaterial );
plyMesh.castShadow = true;
plyMesh.receiveShadow = true;
scene.add( plyMesh );
},
function ( xhr ) { console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); },
function( err ) { console.log( 'An error happened' ); }
)