diff --git a/js/fea/DmaCell.js b/js/fea/DmaCell.js index 9cff4de9eb5e4976b92d4e738ea580fa25939575..112f7c1a274c770816525bfd0e78234ec62c1ba8 100644 --- a/js/fea/DmaCell.js +++ b/js/fea/DmaCell.js @@ -267,7 +267,7 @@ DMACell.prototype.destroy = function(){ }; DMACubeCell.prototype.getHighlighterVertices = function(face){ - if (face.normal.z<0.99) return null;//only highlight horizontal faces +// if (face.normal.z<0.99) return null;//only highlight horizontal faces //the vertices don't include the position transformation applied to cell. Add these to create highlighter vertices var mesh = this.cellMesh.children[0]; diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index 60dc0fe72249cddf42341f59aec9d190f5250db7..64e5cd323108e0334c949cefbb437a160310ec30 100644 --- a/js/menus/MenuWrapperView.js +++ b/js/menus/MenuWrapperView.js @@ -18,7 +18,7 @@ MenuWrapper = Backbone.View.extend({ //init all tab view controllers this.latticeMenu = new LatticeMenuView({model:this.model, lattice:options.lattice}); this.importMenu = new ImportMenuView({lattice:options.lattice, appState:this.model}); - this.sketchMenu = new SketchMenuView({model:options.lattice.get("basePlane"), appState:this.model}); + this.sketchMenu = new SketchMenuView({model:options.lattice, appState:this.model}); this.partMenu = new PartMenuView({model:this.model, lattice:options.lattice}); this.scriptMenu = new ScriptMenuView({model:this.model}); // this.animationMenu = new AnimationMenuView({model:options.lattice.get("basePlane"), appState:this.model}); diff --git a/js/menus/SketchMenuView.js b/js/menus/SketchMenuView.js index 1aefd45cdd4982560cc84116d85474c1ca5642b9..f0b1a0e316f62a1b6d39cc78f8cdd6b6853d2481 100644 --- a/js/menus/SketchMenuView.js +++ b/js/menus/SketchMenuView.js @@ -20,12 +20,12 @@ SketchMenuView = Backbone.View.extend({ }, _moveSketchPlane: function(e){ - this.model.set("zIndex", $(e.target).val()); + this.model.get("basePlane").set("zIndex", $(e.target).val()); }, render: function(){ if (this.appState.get("currentTab") != "sketch") return; - this.$el.html(this.template(this.model.attributes)); + this.$el.html(this.template(this.model.get("basePlane").attributes)); $('#zHeightSlider').slider({ formatter: function(value) { diff --git a/js/models/BasePlane.js b/js/models/BasePlane.js index fb15c4932a1f2f673958cf378cc4cff43f4043e4..e3af6785a29008ec4038987718efb00962d707c1 100644 --- a/js/models/BasePlane.js +++ b/js/models/BasePlane.js @@ -42,15 +42,6 @@ BasePlane = Backbone.Model.extend({ window.three.render(); }, - _renderZIndexChange: function(){ - var zIndex = this.get("zIndex"); - var scale = this.get("mesh").scale.z; - _.each(this.get("mesh"), function(mesh){ - mesh.position.set(0, 0, zIndex*scale*2/Math.sqrt(6)); - }); - window.three.render(); - }, - // _renderForCurrentScene: function(){ // }, @@ -142,6 +133,15 @@ OctaBasePlane = BasePlane.extend({ return [mesh]; }, + _renderZIndexChange: function(){ + var zIndex = this.get("zIndex"); + var scale = this.get("mesh")[0].scale.z; + _.each(this.get("mesh"), function(mesh){ + mesh.position.set(0, 0, zIndex*scale*2/Math.sqrt(6)); + }); + window.three.render(); + }, + _calcOctaFaceVertices: function(colSep){ var vertices = []; @@ -231,7 +231,16 @@ SquareBasePlane = BasePlane.extend({ var mesh = new THREE.Mesh(planeGeometry, new THREE.MeshBasicMaterial({color:0x000000, transparent:true, opacity:0.0, side:THREE.DoubleSide})); mesh.myParent = this;//reference used for intersection highlighting - return [mesh, new THREE.Line(geometry, new THREE.LineBasicMaterial({color:0x000000, transparent:true, linewidth:1, opacity:this.get("material").opacity}), THREE.LinePieces)]; + return [mesh, new THREE.Line(geometry, new THREE.LineBasicMaterial({color:0x000000, transparent:true, linewidth:2, opacity:this.get("material").opacity}), THREE.LinePieces)]; + }, + + _renderZIndexChange: function(){ + var zIndex = this.get("zIndex"); + var scale = this.get("mesh")[0].scale.z; + _.each(this.get("mesh"), function(mesh){ + mesh.position.set(0, 0, zIndex*scale); + }); + window.three.render(); }, getHighlighterVertices: function(face, position){