Hi, I am creating the polygon using array of points using following code:
var lineGeometry = new THREE.BufferGeometry();
lineGeometry.addAttribute('position', new THREE.BufferAttribute(pointsArray, 3));
// material
var lineMaterial = new THREE.LineBasicMaterial({
color: 0x2f58d3,
linewidth: 2
});
// line
line = new THREE.Line(lineGeometry, lineMaterial);
scene.add(line);
meshesFoorDesign.push(line);
I need to remove all the meshes including polygon if user clicks on clear button. I am using below code for doing this. It is doing the job for three js meshes however polygons drawn using buffergeometry and line is not deleted. Any help would be appriciated.
for (var i = 0; i < meshesFoorDesign.length; i++) {
var sceneMesh = meshesFoorDesign[i];
if (typeof (sceneMesh) == "undefined")
continue;
scene.remove(sceneMesh);
sceneMesh.geometry.dispose();
sceneMesh.material.dispose();
}
Version : 103