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

messing around with material setup

parent efd03f38
Branches
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'],
if (material.sparseCells[x][y][z]){
if (material.sparseCells[x][y][z].material) {
cellMaterial = material.sparseCells[x][y][z].material;
console.log(cellMaterial);
this._makeSubCellForIndex({index: new THREE.Vector3(x,y,z), material:cellMaterial}, function(cell){
var index = cell.getIndex();
cells[index.x][index.y][index.z] = cell;
......
......@@ -43,16 +43,19 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
if (returnTHREEObject){
return DMASuperCell.prototype.getMaterial.call(this, returnTHREEObject);
}
return {
// name: name,
material: this.material,
// color: this.get("color"),
// altColor: this.get("color"),
// numCells: this.get("numCells"),
cellsMin: new THREE.Vector3(0,0,0),
cellsMax: new THREE.Vector3(this.getLength(), 0, 0),
dimensions: new THREE.Vector3(this.getLength()+1, 1, 1)
};
if (!materials[this.material]) materials[this.material] = {};
var length = this.getLength();
if (!materials[this.material]["length" + (length+1)]) {
materials[this.material]["length" + (length+1)] =
{
material: this.material,
cellsMin: new THREE.Vector3(0,0,0),
cellsMax: new THREE.Vector3(length, 0, 0),
dimensions: new THREE.Vector3(length+1, 1, 1)
};
}
console.log(materials[this.material]);
return materials[this.material]["length" + (length+1)];
};
GIKSuperCell.prototype._buildWireframe = function(mesh){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment