Commit 1ce7abbb authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

stock offset, gik rotation

parent 79af4108
......@@ -71,7 +71,8 @@ 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, 0));
geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-21, -0.63, 0));//todo get rid of these
geometry.applyMatrix(new THREE.Matrix4().makeRotationZ(Math.PI/2));
return geometry;
}
......
......@@ -30,8 +30,8 @@ define(['underscore', 'cam', 'three', 'component', 'lattice', 'threeModel'],
StockComponent.prototype._setPosition = function(cell, position, rotation){
var object3D = cell.getObject3D();//todo need this?
object3D.position.set(position.x, position.y, position.z);
//todo rotation
if (position) object3D.position.set(position.x, position.y, position.z);
if (rotation) object3D.rotation.set(rotation.x, rotation.y, rotation.z);
};
StockComponent.prototype.getPosition = function(){
......
......@@ -69,6 +69,7 @@ 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;
}
});
......
......@@ -49,7 +49,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
},
_zIndexRotationSuperCell: function(index){
if (index.z%2 != 0) return Math.PI/2;
if (index.z%2 != 0) return Math.PI/2;//this never changes
return 0;
},
......
......@@ -111,7 +111,8 @@ define(['three'], function(THREE){
},
name: "Stock 1",
parent: "zAxis",
position: {x:0,y:0,z:0}
position: {x:0,y:0,z:0},
rotation: {x:0, y:0, z:Math.PI/2}
},
stock2: {
description:{
......@@ -120,7 +121,8 @@ define(['three'], function(THREE){
},
name: "Stock 2",
parent: "zAxis",
position: {x:26,y:0.236,z:0}
position: {x:0.236,y:26,z:0},
rotation: {x:0, y:0, z:Math.PI/2}
}
},
lattice:{
......
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