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

sync with will

parent b45e4965
......@@ -69,6 +69,11 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
if (json.scale) geometry.applyMatrix(new THREE.Matrix4().makeScale(json.scale, json.scale, json.scale));
geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-21, -0.63, -1.28));//todo get rid of these
// geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-4, -4.5, 0));
// geometry.applyMatrix(new THREE.Matrix4().makeRotationZ(-Math.PI/2));
// geometry.applyMatrix(new THREE.Matrix4().makeTranslation(4.5, -4, 0));
// geometry.applyMatrix(new THREE.Matrix4().makeRotationZ(Math.PI/2));
return geometry;
}
......@@ -209,8 +214,8 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
_.each(this.stock, function(stock){
stock.show();
});
if (index.z%2 != 0) {//rotate on odd rows
this.components.substrate.rotateTo(new THREE.Vector3(0, 0, Math.PI/2), speed, callback);
if (index.z%2 == 0) {//rotate on odd rows
this.components.substrate.rotateTo(new THREE.Vector3(0, 0, -Math.PI/2), speed, callback);
return;
}
this.components.substrate.rotateTo(new THREE.Vector3(0, 0, 0), speed, callback);
......
......@@ -121,11 +121,11 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
position.sub(settings.originPosition);
if (index.z%2 != 0){
if (index.z%2 == 0){
//offset for rotation
var offset = self.components.substrate.centerOfRotation.clone().multiplyScalar(settings.scale);//offset in mm
var offset = self.components.substrate.centerOfRotation.clone().multiplyScalar(settings.scale);//offset in lattice pitch
var dist = position.clone().sub(offset);
position = offset.add(new THREE.Vector3(dist.y, -dist.x, position.z));
position = offset.add(new THREE.Vector3(-dist.y-3*settings.scale, dist.x-0.335, position.z));
}
var stock = _.find(self.stock, function(thisStock){
......
......@@ -44,12 +44,12 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
},
_zIndexRotation: function(index){
if (index.z%2 != 0) return Math.PI/2;
if (index.z%2 == 0) return Math.PI/2;
return 0;
},
_zIndexRotationSuperCell: function(index){
if (index.z%2 != 0) return Math.PI/2;//this goes neg if zIndexRotation rules are opp? need to clear this up eventually
if (index.z%2 != 0) return -Math.PI/2;//this goes neg if zIndexRotation rules are opp? need to clear this up eventually
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