Skip to content
Snippets Groups Projects
Commit 08439b51 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

eod

parent 883b5099
Branches
No related tags found
No related merge requests found
......@@ -96,7 +96,8 @@ var cellMaterial = [new THREE.MeshNormalMaterial()];
return this.superCell.getMaterialType();
};
DMAGIKCell.prototype.__initParts = function(){
DMAGIKCell.prototype._initParts = function(){
if (!this.superCell) return [];
var parts = [];
var isEnd = this.superCellIndex == 0 || this.superCellIndex == this.superCell.getLength();
if (dmaGlobals.lattice.get("partType") == "lego") {
......@@ -110,11 +111,6 @@ var cellMaterial = [new THREE.MeshNormalMaterial()];
return parts;
};
DMAGIKCell.prototype._initParts = function(){
if (this.superCell) return this.__initParts();
return [];
};
self.DMAGIKCell = DMAGIKCell;
})();
......
......@@ -229,6 +229,7 @@ var partMaterial = new THREE.MeshLambertMaterial({ color:0xffffff, shading: THRE
var unitScale = 1/(1.2699999809265137);
unitPartGeo.applyMatrix(new THREE.Matrix4().makeRotationX(Math.PI/2));
unitPartGeo.applyMatrix(new THREE.Matrix4().makeScale(unitScale, unitScale, unitScale));
console.log(unitPartGeo);
});
function DMAGIKPart(type, parent){
......@@ -236,9 +237,25 @@ var partMaterial = new THREE.MeshLambertMaterial({ color:0xffffff, shading: THRE
}
DMAGIKPart.prototype = Object.create(DMAPart.prototype);
DMAGIKPart.prototype._makeGikWireframe = function(positions, yPosition){
var geometry = new THREE.Geometry();
_.each(positions, function(position, index){
if (position == yPosition){
geometry.vertices.push(new THREE.Vector3(positions[index-1], yPosition, positions[index+1]));
}
});
console.log(geometry.vertices);
return new THREE.Line(geometry);
};
DMAGIKPart.prototype._makeMeshForType = function(){
var mesh = new THREE.Mesh(unitPartGeo, this.parentCell.getMaterialType());
mesh.myPart = this;//need a ref back to this part
var wireframe = new THREE.EdgesHelper(mesh, 0x000000);
mesh.children.push(wireframe);
return mesh;
};
......
......@@ -5,7 +5,7 @@
function ThreeModel(){
var camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.001, 10000);
var camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 1, 10000);
var scene = new THREE.Scene();
var renderer = new THREE.WebGLRenderer({antialias:true});//antialiasing is not supported in ff and on mac+chrome
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment