From 18c0b79a60643d233530b9620ff3f3ea7d285c89 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Wed, 10 Jun 2015 14:13:12 -0700
Subject: [PATCH] more changes to rot edge baseplane

---
 js/baseplane/BasePlane.js            |  2 +-
 js/baseplane/OctaBasePlane.js        | 24 ++++++++++++------------
 js/baseplane/RotEdgeOctaBasePlane.js |  7 ++++---
 3 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/js/baseplane/BasePlane.js b/js/baseplane/BasePlane.js
index 10a4ea2f..8f312f57 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 2278bd67..0e58993e 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 e3fb3ff4..4e40db83 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;
         }
-- 
GitLab