Commit 22063272 authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent db4c54d3
......@@ -422,8 +422,8 @@
Colored Material
</label>
<div id="coloredMaterialOptions" class="indent">
<label>Color 1 (rgb hex): </label><input id="color1" value="" placeholder="" class="form-control" type="text"><br/>
<label>Color 2 (rgb hex): </label><input id="color2" value="" placeholder="" class="form-control" type="text"><br/>
<label>Color 1 (rgb hex): &nbsp;&nbsp;</label><input id="color1" value="" placeholder="" class="form-control" type="text"><br/>
<label>Color 2 (rgb hex): &nbsp;&nbsp;</label><input id="color2" value="" placeholder="" class="form-control" type="text"><br/>
</div>
<label class="radio">
<input name="colorMode" value="normal" data-toggle="radio" class="custom-radio" type="radio"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
......
......@@ -8,7 +8,7 @@ function initGlobals(){
var _globals = {
//view
colorMode: "normal",
colorMode: "color",
color1: "ec008b",
color2: "ffffff",
......
......@@ -9,14 +9,14 @@ function initModel(globals){
setMeshMaterial();
function setMeshMaterial(){
if (globals.colorMode == "normal"){
material = new THREE.MeshNormalMaterial({shading: THREE.FlatShading, side: THREE.DoubleSide});
material = new THREE.MeshNormalMaterial({side: THREE.DoubleSide});
} else {
material = THREE.MeshFaceMaterial([
new THREE.MeshLambertMaterial({shading:THREE.FlatShading, color:0xff0000, side:THREE.FrontSide}),
new THREE.MeshLambertMaterial({shading:THREE.FlatShading, color:0x0000ff, side:THREE.FrontSide})
]);
material.materials[0].color.setStyle( "#" + globals.color1);
material.materials[1].color.setStyle( "#" + globals.color2);
material.materials[0].color.setStyle( "#" + globals.color2);
material.materials[1].color.setStyle( "#" + globals.color1);
}
if (object3D) object3D.material = material;
}
......@@ -102,6 +102,7 @@ function initModel(globals){
}
geometry.verticesNeedUpdate = true;
geometry.computeFaceNormals();
geometry.computeFlatVertexNormals();
});
}
......@@ -180,6 +181,7 @@ function initModel(globals){
geometry.computeFaceNormals();
geometry.computeBoundingBox();
geometry.computeBoundingSphere();
geometry.center();
globals.shouldSyncWithModel = true;
inited = true;
......
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