Commit 942cac95 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

gik cell orientation worked out

parent 320f600a
......@@ -339,10 +339,10 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
if (totalThreads > 0) return;
callback();
}
var startingPos = {x:this.components.xAxis.getPosition().x, y:this.components.yAxis.getPosition().y, z:this.components.zAxis.getPosition().z};
var startingPos = {x:this.components.yAxis.getPosition().x, y:this.components.xAxis.getPosition().y, z:this.components.zAxis.getPosition().z};
speed = this._normalizeSpeed(startingPos, position, new THREE.Vector3(speed, speed, speed));
this.components.xAxis.moveTo(this._makeAxisVector(position, "x"), speed.x, sketchyCallback);
this.components.yAxis.moveTo(this._makeAxisVector(position, "y"), speed.y, sketchyCallback);
this.components.yAxis.moveTo(this._makeAxisVector(position, "x"), speed.x, sketchyCallback);
this.components.xAxis.moveTo(this._makeAxisVector(position, "y"), speed.y, sketchyCallback);
this.components.zAxis.moveTo(this._makeAxisVector(position, "z"), speed.z, sketchyCallback);
};
......
......@@ -43,7 +43,6 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', '
if (!this.highlightedObject) return;
var index = this.highlightedObject.getAbsoluteIndex();
if (Math.abs(direction.z) > 0.9) index.z+=1;
else if (Math.abs(direction.z) < 0.1) index.z -=1;
if (appState._drawingWithCompositeMaterialType()) this.mesh.rotation.set(0,0, lattice._zIndexRotationSuperCell(index));
else this.mesh.rotation.set(0,0, lattice._zIndexRotation(index));
}
......@@ -69,7 +68,6 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', '
var offset = appState.get("superCellIndex").clone();
offset.applyQuaternion(this.mesh.quaternion).round();
newIndex.sub(offset);
console.log(newIndex.clone());
return newIndex;
}
});
......
......@@ -143,7 +143,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var min = this.get("cellsMin").sub(bounds.min);
var overlap = false;
var forCAM = appState.get("currentNav") == "navAssemble";
console.log(forCAM);
this._loopCells(this.sparseCells, function(cell){
if (!cell) return;
overlap |= cell.addToDenseArray(cells, min, forCAM);
......
......@@ -205,7 +205,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
if (cell){
var material = cell.getMaterial();
var dimensions = material.dimensions;
if (dimensions) dimensions.clone();
if (dimensions) dimensions = dimensions.clone();
else dimensions = new THREE.Vector3(cell.length, 1, 1);
dimensions.sub(new THREE.Vector3(1,1,1));
var subCellRange = (new THREE.Vector3(x, y, z)).add(cell.applyRotation(dimensions).round().add(new THREE.Vector3(1,1,1)));
......
......@@ -49,7 +49,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
},
_zIndexRotationSuperCell: function(index){
if (index.z%2 != 0) return Math.PI/2;//this never changes
if (index.z%2 != 0) return -Math.PI/2;//this never changes
return 0;
},
......
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