Skip to content
Snippets Groups Projects
Commit 2b8d95db authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

clear all button

parent b1549509
No related branches found
No related tags found
No related merge requests found
......@@ -38,3 +38,7 @@ body {
border-top-left-radius: 0!important;
border-top-right-radius: 0!important;
}
nav .btn {
margin-top: 5px;
}
......@@ -49,11 +49,13 @@ function setupNavBar(threeSpace){
//clear canvas
$("#clearAll").click(function(){
_.each(threeSpace.scene.children, function(object) {
if (object instanceof THREE.Mesh){
var children = threeSpace.scene.children;
for (var i=children.length;i>=0;i--){
var object = children[i];
if (object instanceof THREE.Mesh){
threeSpace.scene.remove(object);
}
});
}
threeSpace.render();
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment