diff --git a/js/main.js b/js/main.js index 094b51c66b00d0ab2a13da161f97eea275f0a480..ec7d27621ba958a1c305c55e68e5b28db579d820 100644 --- a/js/main.js +++ b/js/main.js @@ -7,10 +7,10 @@ $(function(){ window.workers = persistentWorkers(8); - three = new ThreeView(); + var three = new ThreeView();//singleton, my threejs view //init models and views - var fillGeometry = new FillGeometry();//singleton + var fillGeometry = new FillGeometry();//singleton, mesh to fill with lattice three.setFillGeometry(fillGeometry); new ImportView({model: fillGeometry}); @@ -20,7 +20,7 @@ $(function(){ - setupNavBar(); + setupNavBar(three); diff --git a/js/views/navbar.js b/js/views/navbar.js index e48dbf05c827af82725f82ff42ae687f73cd1b8c..a97bc86a581952da8f1e0b822f24b12150c78182 100644 --- a/js/views/navbar.js +++ b/js/views/navbar.js @@ -3,7 +3,7 @@ */ -function setupNavBar(){ +function setupNavBar(three){ var allMenus = $(".navMenu"); var allNavMenuLinks = $(".menuHoverControls"); diff --git a/js/views/threeView.js b/js/views/threeView.js index 8684c4f53ad0d3322245a4fa36f80ee522e50ec6..8513e2913244e3cfcb1926a3802656b9fae1d533 100644 --- a/js/views/threeView.js +++ b/js/views/threeView.js @@ -6,6 +6,7 @@ ThreeView = Backbone.View.extend({ el: "#threeContainer", + //this could break off into a model camera: new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 1, 1000), scene: new THREE.Scene(), renderer: new THREE.WebGLRenderer({antialias:false}), @@ -90,7 +91,7 @@ ThreeView = Backbone.View.extend({ var children = this.scene.children; for (var i=children.length;i>=0;i--){ var object = children[i]; - if (object instanceof THREE.Mesh){ + if (object instanceof THREE.Mesh && object != this.fillGeometry.get("mesh")){ this.scene.remove(object); } }