Commit 6869242c authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

baseplane fixed

parent c8778e41
/**
* Created by aghassaei on 8/17/15.
*/
define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three', 'squareBaseplane'],
function(_, Backbone, appState, lattice, three, THREE, SquareBasePlane){
return SquareBasePlane.extend({
calcHighlighterParams: function(face, point){
var params = SquareBasePlane.prototype.calcHighlighterParams.call(this, face, point);
params.position.x += lattice.xScale()/2;
return params;
}
});
});
\ No newline at end of file
......@@ -10,25 +10,25 @@ define(['underscore', 'backbone', 'appState', 'lattice', 'threeModel', 'three',
_makeBasePlaneMesh: function(){
var scale = lattice.xScale();
var dimX = this.get("dimX")*scale;
var dimY = this.get("dimY")*scale;
var xScale = lattice.xScale();
var yScale = lattice.yScale();
var dimX = this.get("dimX");
var dimY = this.get("dimY");
var geometry = new THREE.Geometry();
for ( var i = - dimX; i <= dimX+1; i += scale ) {
geometry.vertices.push( new THREE.Vector3(-dimX-scale/2, i-scale/2, 0.01));
geometry.vertices.push( new THREE.Vector3(dimX-scale/2, i-scale/2, 0.01));
geometry.vertices.push( new THREE.Vector3(i-scale/2, -dimX-scale/2, 0.01));
geometry.vertices.push( new THREE.Vector3(i-scale/2, dimX-scale/2, 0.01));
for ( var i = - dimX; i <= dimX+1; i ++) {
geometry.vertices.push( new THREE.Vector3(-dimX*xScale-xScale/2, i*yScale-yScale/2, 0.01));
geometry.vertices.push( new THREE.Vector3(dimX*xScale-xScale/2, i*yScale-yScale/2, 0.01));
geometry.vertices.push( new THREE.Vector3(i*xScale-xScale/2, -dimX*yScale-yScale/2, 0.01));
geometry.vertices.push( new THREE.Vector3(i*xScale-xScale/2, dimX*yScale-yScale/2, 0.01));
}
var planeGeometry = new THREE.Geometry();
planeGeometry.vertices.push( new THREE.Vector3(-dimX-scale/2, -dimX-scale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(dimX+scale/2, -dimX-scale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(-dimX-scale/2, dimX+scale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(dimX+scale/2, dimX+scale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(-dimX*xScale-xScale/2, -dimX*yScale-yScale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(dimX*xScale+xScale/2, -dimX*yScale-yScale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(-dimX*xScale-xScale/2, dimX*yScale+yScale/2, 0));
planeGeometry.vertices.push( new THREE.Vector3(dimX*xScale+xScale/2, dimX*yScale+yScale/2, 0));
planeGeometry.faces.push(new THREE.Face3(0, 1, 3));
planeGeometry.faces.push(new THREE.Face3(0, 3, 2));
planeGeometry.computeFaceNormals();
......
......@@ -13,7 +13,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var HexRotLattice = {
_initLatticeType: function(){
require(['squareBaseplane'], function(BasePlaneClass){
require(['hexRotBasePlane'], function(BasePlaneClass){
globals.basePlane = new BasePlaneClass();
});
require([this.getHighlighterFile()], function(HighlighterClass){
......
......@@ -62,6 +62,7 @@ require.config({
octaBaseplane: 'baseplane/OctaBasePlane',
rotEdgeOctaBaseplane: 'baseplane/RotEdgeOctaBasePlane',
hexBaseplane: 'baseplane/HexagonalBasePlane',
hexRotBasePlane: 'baseplane/HexagonalRotBasePlane',
//highlighter
highlighter: 'highlighter/Highlighter',
......
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