Skip to content
Snippets Groups Projects
Commit 71017022 authored by amandaghassaei's avatar amandaghassaei
Browse files

toggle mesh vis

parent 7f664000
Branches
No related tags found
No related merge requests found
...@@ -423,6 +423,11 @@ ...@@ -423,6 +423,11 @@
<div class="indent"> <div class="indent">
Mesh Material: Mesh Material:
<div class="indent"> <div class="indent">
<label class="checkbox" for="meshVisible">
<input id="meshVisible" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Mesh Visible
</label>
<div id="meshMaterialOptions">
<label class="radio"> <label class="radio">
<input name="colorMode" value="color" data-toggle="radio" class="custom-radio" type="radio"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> <input name="colorMode" value="color" data-toggle="radio" class="custom-radio" type="radio"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Colored Material Colored Material
...@@ -435,6 +440,7 @@ ...@@ -435,6 +440,7 @@
<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> <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>
Face Normals Material Face Normals Material
</label> </label>
</div>
</div><br/> </div><br/>
Edges: Edges:
<div class="indent"> <div class="indent">
......
...@@ -119,6 +119,13 @@ function initControls(globals){ ...@@ -119,6 +119,13 @@ function initControls(globals){
globals.model.updateEdgeVisibility(); globals.model.updateEdgeVisibility();
}); });
setCheckbox("#meshVisible", globals.meshVisible, function(val){
globals.meshVisible = val;
globals.model.updateMeshVisibility();
if (globals.meshVisible) $("#meshMaterialOptions").show();
else $("#meshMaterialOptions").hide();
});
function setButtonGroup(id, callback){ function setButtonGroup(id, callback){
$(id+" a").click(function(e){ $(id+" a").click(function(e){
e.preventDefault(); e.preventDefault();
......
...@@ -14,6 +14,7 @@ function initGlobals(){ ...@@ -14,6 +14,7 @@ function initGlobals(){
color1: "ec008b", color1: "ec008b",
color2: "dddddd", color2: "dddddd",
edgesVisible: true, edgesVisible: true,
meshVisible: true,
//flags //flags
fixedHasChanged: false, fixedHasChanged: false,
......
...@@ -27,6 +27,10 @@ function initModel(globals){ ...@@ -27,6 +27,10 @@ function initModel(globals){
} }
} }
function updateMeshVisibility(){
object3D.visible = globals.meshVisible;
}
var geometry = new THREE.Geometry(); var geometry = new THREE.Geometry();
geometry.dynamic = true; geometry.dynamic = true;
var object3D = new THREE.Mesh(geometry, material); var object3D = new THREE.Mesh(geometry, material);
...@@ -231,6 +235,7 @@ function initModel(globals){ ...@@ -231,6 +235,7 @@ function initModel(globals){
getObjectsToIntersect: getObjectsToIntersect, getObjectsToIntersect: getObjectsToIntersect,
setMeshMaterial: setMeshMaterial, setMeshMaterial: setMeshMaterial,
updateEdgeVisibility: updateEdgeVisibility, updateEdgeVisibility: updateEdgeVisibility,
updateMeshVisibility: updateMeshVisibility,
getGeometry: getGeometry getGeometry: getGeometry
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment