diff --git a/dependencies/TrackballControls.js b/dependencies/TrackballControls.js index d3e6aeb4f9b805c9737faf88f9c8f0e2d60ec079..2654f4e93ec27e20e862ee8c171da976880cb611 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 1189e3a914041f81c6cabf3d0bf1609e949482fd..149178f36c83f36f1d590fc08b9ca048504a7797 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 60089466bd4bec3371f71939d8a5915eb03f7409..230a62b876120e8b5ed8c36f4185b76d52000747 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 eb5ed812dbe5bb85392712a89519208f3bea543d..7b9142077e7a17e2a35d67251ef685711b89a975 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 0a60803e19ae55a82e3dfa69546fe20d3b3d9164..64ad7a21cf2f75460b677c47d0530513082c2af5 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 2f0e4c64533b8544cb9ee1ff76a190c3cf5f62d7..aba649b434eaae7540b2b9191b4282d38d0e679b 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) );