I\'m using ThreeJS to develop a web application that displays a list of entities, each with corresponding \"View\" and \"Hide\" button; e.g. entityName View Hide
I started to save this as a function, and call it as needed for whatever reactions require it:
function Remove(){ while(scene.children.length > 0){ scene.remove(scene.children[0]); } }
Now you can call the Remove(); function where appropriate.