diff --git a/js/baseplane/BasePlane.js b/js/baseplane/BasePlane.js index 10a4ea2fdd3f23c79a61e709a1712eb7afa1e1e6..8f312f57748c47d27e074cf750e0fc2ed8de39c8 100644 --- a/js/baseplane/BasePlane.js +++ b/js/baseplane/BasePlane.js @@ -56,7 +56,7 @@ define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three'], return this.highligherIndex.clone(); }, - calcHighlighterParams: function(face, point, index){ + calcHighlighterParams: function(face, point, index){//index comes from subclass point.z = 0;//todo this doesn't generalize when baseplane moves if (!index || index === undefined) index = lattice.getIndexForPosition(point); index.z = this.get("zIndex") - 1;//pretend we're on the top of the cell underneath the baseplane diff --git a/js/baseplane/OctaBasePlane.js b/js/baseplane/OctaBasePlane.js index 2278bd67dd771e00c4322ee52ab66948b823c741..0e58993ea976d084f5fa5f11945363086878f690 100644 --- a/js/baseplane/OctaBasePlane.js +++ b/js/baseplane/OctaBasePlane.js @@ -38,18 +38,18 @@ define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three', return [new THREE.Mesh(geometry, this.get("material"))]; }, - _renderZIndexChange: function(){ - var zIndex = this.get("zIndex"); - var xScale = lattice.xScale(); - var yScale = lattice.yScale(); - var zScale = lattice.zScale(); - - _.each(this.get("mesh"), function(mesh){ - mesh.position.set(xScale*(zIndex%2)/2, -yScale/3*(zIndex%2), zIndex*zScale); - mesh.rotation.set(Math.PI*(zIndex%2),0,0) - }); - three.render(); - }, +// _renderZIndexChange: function(){ +// var zIndex = this.get("zIndex"); +// var xScale = lattice.xScale(); +// var yScale = lattice.yScale(); +// var zScale = lattice.zScale(); +// +// _.each(this.get("mesh"), function(mesh){ +// mesh.position.set(xScale*(zIndex%2)/2, -yScale/3*(zIndex%2), zIndex*zScale); +// mesh.rotation.set(Math.PI*(zIndex%2),0,0) +// }); +// three.render(); +// }, _calcOctaFaceVertices: function(xySep){ diff --git a/js/baseplane/RotEdgeOctaBasePlane.js b/js/baseplane/RotEdgeOctaBasePlane.js index e3fb3ff48191445a16949fa210bedb5be9a42d47..4e40db830e6f0e05d89d7c33846b92fb0a6b9a1f 100644 --- a/js/baseplane/RotEdgeOctaBasePlane.js +++ b/js/baseplane/RotEdgeOctaBasePlane.js @@ -13,10 +13,11 @@ define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three', object3D.position.set(0,0,height-lattice.zScale()); }, - calcHighlighterParams: function(face, point, index){ + calcHighlighterParams: function(face, point){ + point.z = 0; + var index = lattice.getIndexForPosition(point); + index.sub(new THREE.Vector3(0.5, 0.5, 0)); var params = SquareBasePlane.prototype.calcHighlighterParams.call(this, face, point, index); - params.position.x -= lattice.xScale()/2; - params.position.y -= lattice.yScale()/2; params.position.z -= lattice.zScale()/2; return params; }