Commit c8778e41 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

highlihgter on hex lattice

parent a6cc492e
......@@ -19,5 +19,9 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'hexCell'],
return unitCellGeo;
};
HexagonalCell.prototype.aspectRatio = function(){
return new THREE.Vector3(this.xScale()-1, this.yScale(), this.zScale()+Math.sqrt(3)/2);
};
return HexagonalCell;
});
\ No newline at end of file
......@@ -36,7 +36,9 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
getPositionForIndex: function(index){
var position = this._positionForIndex(index);
if ((index.y%2) != 0) position.x -= this.xScale()/2;
if (index.z%2 != 0) {
position.x -= this.xScale()/2;
}
return position;
},
......@@ -52,7 +54,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
zScale: function(cellSeparation){
if (cellSeparation === undefined) cellSeparation = this.get("cellSeparation").z;
return Math.sqrt(3)+2*cellSeparation;
return Math.sqrt(3)/2+2*cellSeparation;
},
getCellSubclassFile: function(){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment