w3reality / three-geo

3D geographic visualization library
MIT License
1.06k stars 178 forks source link

How to edit the terrains #3

Open j-devel opened 5 years ago

j-devel commented 5 years ago

I expect a rudimentary example that shows how to post-process the generated terrain.

In particular, I am interested in incrementally updating the terrain using point clouds obtained by remote sensing devices such as RGBD cameras (e.g. https://github.com/tum-vision/fastfusion) or LIDAR.

j-devel commented 5 years ago

As an entry point, one can access the underlying terrain data (an array containing the 3D points of the terrain) as follows.

    onRgbDem: (meshes) => {
        meshes.forEach((mesh) => {
            const array = mesh.geometry.attributes.position.array;
        });
    },

Since each mesh is a THREE.Mesh object that's based on THREE.PlaneBufferGeometry, for more details on the internal structure, refer to

https://threejs.org/docs/#api/en/core/BufferAttribute