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

three out of global scope, clearall down't remove fillGeometry

parent 0eae8a92
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -3,7 +3,7 @@
*/
function setupNavBar(){
function setupNavBar(three){
var allMenus = $(".navMenu");
var allNavMenuLinks = $(".menuHoverControls");
......
......@@ -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);
}
}
......
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