【问题标题】:colored point cloud (.ply) does not display in three.js彩色点云 (.ply) 不显示在 three.js 中
【发布时间】:2021-09-20 13:29:53
【问题描述】:

我正在尝试使用层加载器在 three.js 中加载彩色点云。我关注this example,但它与我的用例不同。我使用的是点云而不是网格。

所以,这是what I want to load.

你可以看到它looks like from here.

以及我上传 ply 文件的代码部分:

    const loader = new PLYLoader();
    loader.load( 'samplePcd/fragment.ply', function ( geometry ) {
            const material = new THREE.PointsMaterial( {size: 0.01} );
            material.vertexColors = true;
            const mesh = new THREE.Points( geometry, material );
            mesh.position.x = 0;
            mesh.position.y = -1;
            mesh.position.z = 0;
            mesh.scale.multiplyScalar(0.2 );
            mesh.castShadow = true;
            mesh.receiveShadow = true;
            scene.add( mesh );
        } );

结果什么都没有。我无法显示任何内容。他们的颜色如何获得重点?

要重现,您可以创建本地服务器并使用this html

【问题讨论】:

    标签: javascript three.js point-clouds ply-file-format


    【解决方案1】:

    这确实是我的错。我无法以正确的方式下载 ply 文件。所以上面的代码适用于彩色层点云。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-04
      相关资源
      最近更新 更多