Commit f1357b05 authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent ec4f1687
......@@ -620,11 +620,12 @@
<span class="dropdown-arrow"></span>
<ul class="dropdown-menu">
<li><a id="menuVis" href="#">Toggle Menu Visibility</a></li>
<li><a id="changeBackground" href="#">Change Background Color...</a></li>
<li class="divider"></li>
<li><a id="stopRotation" href="#">Stop Rotation</a></li>
<li><a id="rotateX" href="#">Rotate Model X</a></li>
<li><a id="rotateY" href="#">Rotate Model Y</a></li>
<li><a id="rotateZ" href="#">Rotate Model Z</a></li>
<li><a id="stopRotation" href="#">Stop Rotation</a></li>
<li><a id="changeRotationSpeed" href="#">Change Rotation Speed...</a></li>
<li class="divider"></li>
<li><a href="#" id="cameraZ">View Front</a></li>
......@@ -1203,5 +1204,20 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="changeBackgroundModal" tabindex="-1" role="dialog">
<div class="modal-dialog sm">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<p><b>BACKGROUND COLOR</b><br/><br/>
Color (rgb hex) : &nbsp;&nbsp;<input id="backgroundColor" value="" placeholder="" class="hexVal form-control" type="text">
</p>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</body>
</html>
\ No newline at end of file
......@@ -135,6 +135,14 @@ function initControls(globals){
globals.rotationSpeed = val;
}, 0);
setLink("#changeBackground", function(){
$("#changeBackgroundModal").modal("show");
});
setHexInput("#backgroundColor", globals.backgroundColor, function(val){
globals.backgroundColor = val;
globals.threeView.setBackgroundColor();
});
setLink("#navPattern", function(){
if (globals.noCreasePatternAvailable()){
......
......@@ -80,7 +80,9 @@ function initGlobals(){
numSteps: 100,
rotateModel: null,
rotationSpeed: 0.01
rotationSpeed: 0.01,
backgroundColor:"ffffff"
};
function setCreasePercent(percent){
......
......@@ -19,5 +19,5 @@ $(function() {
globals.rigidSolver = initRigidSolver(globals);
globals.pattern = initPattern(globals);
globals.vive = initViveInterface(globals);
$(".demo[data-url='Tessellations/langHoneycomb.svg']").click();//load demo models
$(".demo[data-url='Tessellations/huffmanExtrudedBoxes.svg']").click();//load demo models
});
\ No newline at end of file
......@@ -22,6 +22,7 @@ function initThreeView(globals) {
container.append(renderer.domElement);
scene.background = new THREE.Color(0xffffff);//new THREE.Color(0xe6e6e6);
setBackgroundColor();
scene.add(modelWrapper);
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight1.position.set(0, 100, 0);
......@@ -191,6 +192,10 @@ function initThreeView(globals) {
modelWrapper.rotation.set(0,0,0);
}
function setBackgroundColor(){
scene.background.setStyle( "#" + globals.backgroundColor);
}
return {
sceneAddModel: sceneAddModel,
......@@ -214,6 +219,7 @@ function initThreeView(globals) {
setCameraZ: setCameraZ,
setCameraOrtho: setCameraOrtho,
resetModel: resetModel//reset model orientation
resetModel: resetModel,//reset model orientation
setBackgroundColor: setBackgroundColor
}
}
\ No newline at end of file
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