I recently upgraded from three.js version 71 to version 84 and encountered a problem with updating points in the scene. Previously, with THREE.PointCloud, it was simple to add and remove points as needed like so:
function updatePoints(newData) {
geometry.dispose();
geometry.vertices = [];
geometry.vertices.push(...);
scene.add(newPoints);
render();
}
However, in version 84, THREE.PointCloud has been replaced by THREE.Points and the previous method no longer functions as expected. I am unsure of the reason why. While my code worked flawlessly in version 71, in version 84 only some points are removed. The raycaster does not interact with the points meant to be removed, they cannot be animated, yet they remain visible in the scene.
I have attempted various solutions such as adding scene.remove(oldPoints);
and
geometry.verticesNeedUpdate = true;
within the function, as well as applying different setTimeout
functions before rendering and adding the points to the scene. Unfortunately, none of these approaches have resolved the issue.
I would greatly appreciate any assistance in addressing this issue.
Thank you,
k