diff --git a/js/cam/assemblers/Assembler.js b/js/cam/assemblers/Assembler.js index 7e78d7ccef98a9ff15a336a145e359aa020a8a0c..385d8a20d87029ae09ad97024ed56461ba9cea35 100644 --- a/js/cam/assemblers/Assembler.js +++ b/js/cam/assemblers/Assembler.js @@ -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; } diff --git a/js/cam/assemblers/StockComponent.js b/js/cam/assemblers/StockComponent.js index 6ae114be96c1920a3b425641ab295e33e45786f4..b258bc18b50ce57b8e08f5fac43d78ac313538fe 100644 --- a/js/cam/assemblers/StockComponent.js +++ b/js/cam/assemblers/StockComponent.js @@ -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(){ diff --git a/js/highlighter/SuperCellHighlighter.js b/js/highlighter/SuperCellHighlighter.js index c14bc71280d96d89919f7af8ab22ad5109c2629b..14d6bec7a8c61dae364053221cc49b67f9b7772a 100644 --- a/js/highlighter/SuperCellHighlighter.js +++ b/js/highlighter/SuperCellHighlighter.js @@ -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; } }); diff --git a/js/lattice/latticeSubclasses/GIKLattice.js b/js/lattice/latticeSubclasses/GIKLattice.js index e677c707a88af8ba6b2c8a22593885d4d66d1adf..4ad1b24d8b4337a0a4ae6d7e2bf9763d72d7b3fd 100644 --- a/js/lattice/latticeSubclasses/GIKLattice.js +++ b/js/lattice/latticeSubclasses/GIKLattice.js @@ -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; }, diff --git a/js/plists/CamPList.js b/js/plists/CamPList.js index fa1a63aab50cf2f1923fb444f24f997972e025db..063694599e8ce2cb728e734b6661678e8ca7a4cd 100644 --- a/js/plists/CamPList.js +++ b/js/plists/CamPList.js @@ -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:{