Hi,
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') {
this.scene
.getObjectByProperty('uuid', element.uuid)
.geometry.dispose()
this.scene
.getObjectByProperty('uuid', element.uuid)
.material.dispose()
this.scene.remove(
this.scene.getObjectByProperty('uuid', element.uuid)
)
this.redraw()
}
})
var loader = new THREE.PCDLoader()
let self = this
loader.load(
'http://172.21.1.144:8081/static/env.pcd',
function(mesh) {
self.scene.add(mesh)
},
function(xhr) {
console.log((xhr.loaded / xhr.total) * 100 + '% loaded')
},
function(error) {
console.log(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.