How to live update the point cloud data in three js


In my scene i am a loading pcd file, it works fine. The pcd file changes as we can scan the enivronment. I try to load the live feed from camera to pcd into the scene, but i dont know to do it.

i tried to put a setinterval and delete the current point cloud and load the next one, this doesnt give me a continous video like visualisation.

loadEnvironment() {
      this.scene.children.forEach(element => {
        if (element.type == 'Points') {
            .getObjectByProperty('uuid', element.uuid)
            .getObjectByProperty('uuid', element.uuid)
            this.scene.getObjectByProperty('uuid', element.uuid)

      var loader = new THREE.PCDLoader()
      let self = this
        function(mesh) {
        function(xhr) {
          console.log((xhr.loaded / * 100 + '% loaded')
        function(error) {
      /*        */

Is it possible to keep on updating the current mesh rather than creating and deleting the old one.

im really new to these stuff.

You can update the existing geometry attributes if the buffer size does not change. Meaning if you need larger buffers, you have to dispose the geometry and replace it with a new one. Unfortunately, three.js does not support the disposal of individual attributes.

The following example shows how you update a buffer attribute: