Commit 86af735f authored by amandaghassaei's avatar amandaghassaei

transparency fix

parent 45273243
......@@ -254,7 +254,13 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
};
DMACell.prototype.setWireframeVisibility = function(visible){
this.object3D.children[1].visible = visible;
this.getWireFrameMesh().visible = visible;
};
DMACell.prototype.getWireFrameMesh = function(){
var children = this.object3D.children;
if (children[1].name == "part") return children[2];
return children[1];
};
......@@ -265,15 +271,6 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
var geometry = [];
if (this.isTransparent) return geometry;
if (!this.object3D.visible) return geometry;
//var meshes = _.filter(this.object3D.children, function(child){
// return child.visible && child instanceof THREE.Mesh
//});
//if (meshes.length > 0) {
// var self = this;
// _.each(meshes, function(mesh){
// geometry.push();
// });
//}
var mesh = this.getVisibleMesh();
if (mesh.visible) geometry.push({geo: mesh.geometry, offset:this.getPosition(), orientation:mesh.quaternion.clone().multiply(this.getOrientation())});
return geometry;
......
......@@ -431,7 +431,7 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
};
DMAMaterial.prototype._makeMaterialObject = function(color, transparent){
if (transparent) return new THREE.MeshLambertMaterial({color:color, transparent: true, opacity:0.4});
if (transparent) return new THREE.MeshLambertMaterial({color:color, transparent:true, opacity:0.4});
var json = {color: color};
if (this.texture) json.map = THREE.ImageUtils.loadTexture("assets/textures/"+this.texture+".png");
return new THREE.MeshLambertMaterial(json);
......
......@@ -111,7 +111,7 @@ define([], function(){
}
},
flexureCond: {
name: "Iso-Flex Electronic Routing (Straight)",
name: "Flex Electronic Routing (Straight)",
color: "#b4ac9c",
altColor: "#b4ac9c",
texture: "stripes",
......@@ -124,7 +124,7 @@ define([], function(){
}
},
flexureCondBend: {
name: "Iso-Flex Electronic Routing (Bend)",
name: "Flex Electronic Routing (Bend)",
color: "#b4ac9c",
altColor: "#b4ac9c",
texture: "stripes",
......
......@@ -10,7 +10,7 @@ define(['three'], function(THREE){
name: "Design",
tabs:{
lattice:"Lattice",
sketch:"Planes",
sketch:"Visibility",
select:"Select",
material:"Materials",
// import:"Import",
......
Markdown is supported
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