improve default handling color

This commit is contained in:
Val Erastov 2015-01-15 20:34:22 -08:00
parent baadd79d79
commit ffa7121bb5
2 changed files with 9 additions and 5 deletions

View file

@ -80,7 +80,7 @@ TCAD.utils.createLine = function (a, b, color) {
TCAD.utils.createSolidMesh = function(faces) {
var material = new THREE.MeshPhongMaterial({
vertexColors: THREE.FaceColors,
color: '#B0C4DE',
color: TCAD.view.FACE_COLOR,
shininess: 0
});
var geometry = new TCAD.Solid(faces, material);
@ -165,7 +165,7 @@ TCAD.utils.isPointInsidePolygon = function( inPt, inPolygon ) {
}
return inside;
}
};
TCAD.utils.sketchToPolygons = function(geom) {

View file

@ -4,10 +4,14 @@ TCAD.view = {};
TCAD.view.setFaceColor = function(polyFace, color) {
for (var i = 0; i < polyFace.faces.length; ++i) {
var face = polyFace.faces[i];
face.color.set( color );
if (color == null) {
face.color = new THREE.Color();
} else {
face.color.set( color );
}
}
};
TCAD.view.FACE_COLOR = 0xB0C4DE;
TCAD.Viewer = function() {
function aspect() {
@ -79,7 +83,7 @@ TCAD.Viewer = function() {
**/
this.selectionMgr = new TCAD.FaceSelectionManager( 0xFAFAD2, 0xB0C4DE);
this.selectionMgr = new TCAD.FaceSelectionManager( 0xFAFAD2, null);
var projector = new THREE.Projector();
var raycaster = new THREE.Raycaster();