Using PLY Loader in an Angular 7 project

loaders
angular
#1

I have installed the three-full library in the angular project and I am using ply loader just like shown in the example code but the rendering is without any texture. Can somebody please help.

This is the code for loading this 3d file.

    var loader = new THREE.PLYLoader();
    loader.load('assets/Lucy100k.ply', geometry => {
      geometry.computeVertexNormals();

      var material = new THREE.MeshStandardMaterial({ 
        color: 0x0055ff,
        flatShading: true
       });
      var mesh = new THREE.Mesh(geometry, material);

      mesh.position.x = - 0.2;
      mesh.position.y =  0.03;
      mesh.position.z = - 0.2;
      //mesh.rotation.x = - Math.PI / 2;
      mesh.scale.multiplyScalar(0.5);

      mesh.castShadow = true;
      mesh.receiveShadow = true;

      this.scene.add( mesh );
      this.scene.add(new THREE.HemisphereLight(0x443333, 0x111122));
      this.addShadowedLight(1, 1, 1, 0xffffff, 1.35);
      this.addShadowedLight(0.5, 1, - 1, 0xffaa00, 1);
      this.render()
    }, undefined, function ( error ) {
      console.error( error );
    });
#2

I have solved it.

I changed from THREE.MeshStandardMaterial to THREE.MeshNormalMaterial

#3

Um, I don’t see in your code a section where textures are added to your material.

#4

This particular 3d file came with the three.js examples. There was only one ply file. There was no textures given in the example. I just tried to implement provided by three.js in angular. Here is the code: https://github.com/mrdoob/three.js/blob/dev/examples/webgl_loader_ply.html
and here is the rendering: https://threejs.org/examples/webgl_loader_ply.html
No texture was given in this example too.