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

correct octa geometry

parent 75b22b7a
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
(function () {
var octHeight = 3*30/8*Math.sqrt(5);//this isn't quite right
var octHeight = 2*30/Math.sqrt(6);
var cellGeometry1 = new THREE.OctahedronGeometry(30/Math.sqrt(2));
cellGeometry1.applyMatrix(new THREE.Matrix4().makeRotationZ(-3*Math.PI/12));
......@@ -37,7 +37,7 @@
DMACell.prototype._calcPositionForScale = function(scale){
var position = {};
var indices = this.indices;
var octHeight = 3*scale/8*Math.sqrt(5);//this isn't quite right
var octHeight = 2*scale/Math.sqrt(6);
var triHeight = scale/2*Math.sqrt(3);
position.x = indices.x*scale;
position.y = indices.y*triHeight;
......
......@@ -32,7 +32,7 @@ Lattice = Backbone.Model.extend({
//calc indices in cell matrix
var scale = this.get("scale");
var octHeight = 3*scale/8*Math.sqrt(5);//this isn't quite right
var octHeight = 2*scale/Math.sqrt(6);
var triHeight = scale/2*Math.sqrt(3);
var position = {};
position.x = Math.round(absPosition.x/scale);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment