【发布时间】: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