From 314ef865bc0ba76681371d4a6ac1a40e3b3074dd Mon Sep 17 00:00:00 2001 From: amandaghassaei <amandaghassaei@gmail.com> Date: Thu, 11 May 2017 01:08:06 -0400 Subject: [PATCH] small fixes --- dependencies/TrackballControls.js | 4 ++-- index.html | 5 +---- js/ViveInterface.js | 9 ++++----- js/main.js | 2 +- js/model.js | 1 + js/node.js | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dependencies/TrackballControls.js b/dependencies/TrackballControls.js index d3e6aeb..2654f4e 100755 --- a/dependencies/TrackballControls.js +++ b/dependencies/TrackballControls.js @@ -394,8 +394,8 @@ THREE.TrackballControls = function ( object, domElement ) { if ( _this.enabled === false ) return; - event.preventDefault(); - event.stopPropagation(); + // event.preventDefault(); + // event.stopPropagation(); if ( _state === STATE.NONE ) { diff --git a/index.html b/index.html index 1189e3a..149178f 100755 --- a/index.html +++ b/index.html @@ -613,10 +613,7 @@ Status: <span id="VRstatus"></span> <a class="about floatRight" href="#" id="aboutVR"><span class="fui-question-circle"></span></a><br/> <div id="VRoptions"> - <label class="checkbox" for="vrEnabled"> - <input id="vrEnabled" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> - Connect - </label> + </div> </div> </div> diff --git a/js/ViveInterface.js b/js/ViveInterface.js index 6008946..230a62b 100755 --- a/js/ViveInterface.js +++ b/js/ViveInterface.js @@ -15,7 +15,8 @@ function initViveInterface(globals){ $status.html("No device connected."); $("#VRoptions").show(); - var mesh = new THREE.Mesh(new THREE.CubeGeometry(1,1,1), new THREE.MeshLambertMaterial({color:0xff0000})); + var mesh = new THREE.Mesh(new THREE.CubeGeometry(0.01,0.01,0.01), new THREE.MeshLambertMaterial({color:0xff0000})); + mesh.visible = false; var controls = new THREE.VRControls(globals.threeView.camera); controls.standing = true; @@ -41,7 +42,8 @@ function initViveInterface(globals){ if (!display) return; $status.html("VR device detected."); var button = WEBVR.getButton( display, globals.threeView.renderer.domElement ); - document.body.appendChild(button); + console.log(button); + $("#VRoptions").html(button); var callback = button.onclick; button.onclick = function () { globals.vrEnabled = !display.isPresenting; @@ -55,9 +57,6 @@ function initViveInterface(globals){ } ); } - function disconnect(){ - } - function render(){ controller1.update(); controller2.update(); diff --git a/js/main.js b/js/main.js index eb5ed81..7b91420 100755 --- a/js/main.js +++ b/js/main.js @@ -17,6 +17,6 @@ $(function() { globals.staticSolver = initStaticSolver(globals); globals.dynamicSolver = initDynamicSolver(globals); globals.pattern = initPattern(globals); - // globals.vive = initViveInterface(globals); + globals.vive = initViveInterface(globals); $(".demo[data-url='Tessellations/waterbomb.svg']").click(); }); \ No newline at end of file diff --git a/js/model.js b/js/model.js index 0a60803..64ad7a2 100755 --- a/js/model.js +++ b/js/model.js @@ -173,6 +173,7 @@ function initModel(globals){ geometry.attributes.position.needsUpdate = true; if (globals.colorMode == "axialStrain") geometry.attributes.color.needsUpdate = true; else geometry.computeVertexNormals(); + // if (globals.userInteractionEnabled) geometry.computeBoundingSphere(); // geometry.computeBoundingBox(); // geometry.computeBoundingSphere(); } diff --git a/js/node.js b/js/node.js index 2f0e4c6..aba649b 100755 --- a/js/node.js +++ b/js/node.js @@ -6,7 +6,7 @@ var nodeMaterial = new THREE.MeshBasicMaterial({color: 0x000000, side:THREE.Doub var nodeMaterialFixed = new THREE.MeshBasicMaterial({color: 0x000000, side:THREE.DoubleSide}); var nodeMaterialHighlight = new THREE.MeshBasicMaterial({color: 0xffffff, side:THREE.DoubleSide}); var transparentMaterial = new THREE.MeshBasicMaterial({color: 0xffffff, side:THREE.DoubleSide, opacity:0.5, transparent:true}); -var nodeGeo = new THREE.SphereGeometry(3,20); +var nodeGeo = new THREE.SphereGeometry(0.04,20); nodeGeo.rotateX(Math.PI/2); var nodeFixedGeo = new THREE.CubeGeometry(1, 1, 1); nodeFixedGeo.applyMatrix( new THREE.Matrix4().makeTranslation(0, 0.25, 0) ); -- GitLab