0

我正在尝试从后端加载 PLY 模型,但是它们显示不正确(这三座山应该是 3 种扫描树木的模型)。 我试图改变网格,但它不会改变显示的线条而不是点。代码:

public prepare3d():void{
var height= 400;
var width = this.rendererContainer.nativeElement.clientWidth;
var scene = new THREE.Scene();
scene.background = new THREE.Color( 0xEEEEEE );
const fov = 45;
const aspect = width / height;
const near = 1;
const far = 1000;
var camera = new THREE.PerspectiveCamera( 75, width / height, 0.1, 1000 );
camera.position.set( 3, 0.15, 3 );
var cameraTarget = new THREE.Vector3( 0, - 0.1, 0 );
var geometry = new THREE.BoxGeometry();

loader.load( '/assets/v1.ply', function ( geometry ) {
      geometry.computeVertexNormals();
      var material = new THREE.MeshStandardMaterial( { color: 0x0055ff, flatShading: true } );
      var mesh = new THREE.Mesh( geometry, material );

      mesh.position.y = 0;
      mesh.position.z = 0.3;
      mesh.rotation.x = - Math.PI / 2;
      mesh.scale.multiplyScalar( 0.001 );

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

      scene.add( mesh );

    });
}
4

0 回答 0