【问题标题】:Get all points from pointcloud where pointcloud is new Potree.PointCloudOctree(geometry)从点云中获取所有点,其中点云是新的 Potree.PointCloudOctree(geometry)
【发布时间】:2019-01-15 16:18:49
【问题描述】:

我使用 potree 查看我的模型,我想获取点云中所有点的列表,以根据其索引向每个点添加事件。我可以在不使用测量工具的情况下获得所有点的列表吗? 我想从点云中获得积分

 Potree.loadPointCloud(cloudPointsPath, "name", e => {
                var pointcloud = e.pointcloud;
                var material = pointcloud.material;
                viewer.scene.addPointCloud(pointcloud);
                material.pointColorType = Potree.PointColorType.RGB;
                material.size = 1;
                material.pointSizeType = Potree.PointSizeType.FIXED;
                material.shape = Potree.PointShape.PARABOLOI;
                viewer.fitToScreen();
            });

【问题讨论】:

  • 此要求是否适用如果不适用我如何在点上添加事件并获得点击点
  • 我相信您在错误的标签下发布了您的问题。 potree 写在 webgl 之上,而不是 three.js
  • @gaitat 我编辑了问题以明确

标签: point-clouds


【解决方案1】:

我使用此代码获得了点列表

 function getAllPointsOfPointCloud(pointCloud) {
            var list = [];
            var array = pointCloud.pcoGeometry.root.geometry.attributes.position.array;
            var index = 0;
            for (var i = 0; i < pointCloud.pcoGeometry.root.geometry.attributes.position.length;i=i+3) {
                var x = array[i + 0];
                var y = array[i+ 1];
                var z = array[i + 2];
                let position = new THREE.Vector3(x, y, z);
                position.applyMatrix4(pointCloud.matrixWorld);
                list[index] = position;
                index++;
            }
            return list;
        }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 1970-01-01
    • 1970-01-01
    • 2021-02-10
    • 2013-09-04
    • 2018-01-29
    • 2020-12-20
    相关资源
    最近更新 更多