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

more changes to rot edge baseplane

parent 18de27c9
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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){
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment