diff --git a/js/fea/DmaCell.js b/js/fea/DmaCell.js index e077cb06a26a6ce991ac7868ae78acfd2704f006..20c1e5d8dfca0d2bb469d0bab772ff4d6973f4be 100644 --- a/js/fea/DmaCell.js +++ b/js/fea/DmaCell.js @@ -101,11 +101,10 @@ DMACell.prototype.destroy = function(){ (function () { - var unitOctHeight = 2/Math.sqrt(6); - var unitCellGeo1 = new THREE.OctahedronGeometry(1/Math.sqrt(2)); unitCellGeo1.applyMatrix(new THREE.Matrix4().makeRotationZ(-3*Math.PI/12)); unitCellGeo1.applyMatrix(new THREE.Matrix4().makeRotationX(Math.asin(2/Math.sqrt(2)/Math.sqrt(3)))); +// var unitOctHeight = 2/Math.sqrt(6); // unitCellGeo1.applyMatrix(new THREE.Matrix4().makeTranslation(0,0,unitOctHeight/2)); var unitCellGeo2 = unitCellGeo1.clone(); @@ -156,10 +155,7 @@ DMACell.prototype.destroy = function(){ // }); var position = dmaGlobals.lattice.getPositionForIndex(this.indices); -// var scale = dmaGlobals.lattice.xScale(); -// _.each(_.keys(position), function(key){ -// position[key] += direction[key]*scale/2; -// }); + position.z += dmaGlobals.lattice.zScale()/2; return {index: _.clone(this.indices), direction:direction, position:position}; } diff --git a/js/menus/SketchMenuView.js b/js/menus/SketchMenuView.js index f0b1a0e316f62a1b6d39cc78f8cdd6b6853d2481..8349d5421c928b6933cc6eef9f98843473d08eb0 100644 --- a/js/menus/SketchMenuView.js +++ b/js/menus/SketchMenuView.js @@ -35,7 +35,7 @@ SketchMenuView = Backbone.View.extend({ }, template: _.template('\ - Sketch Plane Height: <input id="zHeightSlider" data-slider-id="ex1Slider" type="text" data-slider-min="0" data-slider-max="20" data-slider-step="2" data-slider-value="<%= zIndex %>"/>\ + Sketch Plane Height: <input id="zHeightSlider" data-slider-id="ex1Slider" type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="<%= zIndex %>"/>\ ') }); \ No newline at end of file diff --git a/js/models/BasePlane.js b/js/models/BasePlane.js index 227cecf05847aaac4932e41567be355696d6c112..b349f156385ea963543644665b9c9b3d30658c9c 100644 --- a/js/models/BasePlane.js +++ b/js/models/BasePlane.js @@ -130,6 +130,7 @@ OctaBasePlane = BasePlane.extend({ var scale = dmaGlobals.lattice.get("scale"); _.each(this.get("mesh"), function(mesh){ mesh.position.set(0, 0, zIndex*scale*2/Math.sqrt(6)); + mesh.rotation.set(Math.PI*(zIndex%2),0,0) }); dmaGlobals.three.render(); }, diff --git a/js/threeViews/Highlighter.js b/js/threeViews/Highlighter.js index f449340d13ec129daaf5591a8ca80fddd92f62a8..7a2fff7cd42a54098931eb3475870bed053e367b 100644 --- a/js/threeViews/Highlighter.js +++ b/js/threeViews/Highlighter.js @@ -89,7 +89,7 @@ Highlighter = Backbone.View.extend({ _setPosition: function(position, direction){ this.mesh.position.set(position.x, position.y, position.z); -// this.mesh.rotation.set(direction.y*Math.PI, direction.x*Math.PI, 0); + this.mesh.rotation.set(direction.y*Math.PI/2, direction.x*Math.PI/2, 0); // this.mesh.updateMatrix(); }, @@ -137,8 +137,13 @@ OctaFaceHighlighter = Highlighter.extend({ var rad = 1/Math.sqrt(3); var geometry = new THREE.CylinderGeometry(rad, rad, 0.01, 3);//short triangular prism - geometry.applyMatrix(new THREE.Matrix4().makeRotationX(Math.PI)); + geometry.applyMatrix(new THREE.Matrix4().makeRotationX(-Math.PI/2)); return geometry; + }, + + _setPosition: function(position){ + this.mesh.position.set(position.x, position.y, position.z); + this.mesh.rotation.set(0,0,(this.index.z+1)%2*Math.PI); } });