diff --git a/js/cells/HexagonalRotCell.js b/js/cells/HexagonalRotCell.js index 16103610a6eb54bb2072113ed0837ac9fb61231b..edc2e2a1a63d15f8958e5567db54a244c1da0578 100644 --- a/js/cells/HexagonalRotCell.js +++ b/js/cells/HexagonalRotCell.js @@ -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 diff --git a/js/lattice/latticeSubclasses/HexagonalRotLattice.js b/js/lattice/latticeSubclasses/HexagonalRotLattice.js index 70bef6e89bb2b9641977612ae834ace439dfcde2..550f553d8ec1aa4e2a6244446fb05494c623d6fc 100644 --- a/js/lattice/latticeSubclasses/HexagonalRotLattice.js +++ b/js/lattice/latticeSubclasses/HexagonalRotLattice.js @@ -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(){