Commit 314ef865 authored by amandaghassaei's avatar amandaghassaei
Browse files

small fixes

parent 124944a9
...@@ -394,8 +394,8 @@ THREE.TrackballControls = function ( object, domElement ) { ...@@ -394,8 +394,8 @@ THREE.TrackballControls = function ( object, domElement ) {
if ( _this.enabled === false ) return; if ( _this.enabled === false ) return;
event.preventDefault(); // event.preventDefault();
event.stopPropagation(); // event.stopPropagation();
if ( _state === STATE.NONE ) { if ( _state === STATE.NONE ) {
......
...@@ -613,10 +613,7 @@ ...@@ -613,10 +613,7 @@
Status: &nbsp;<span id="VRstatus"></span> Status: &nbsp;<span id="VRstatus"></span>
<a class="about floatRight" href="#" id="aboutVR"><span class="fui-question-circle"></span></a><br/> <a class="about floatRight" href="#" id="aboutVR"><span class="fui-question-circle"></span></a><br/>
<div id="VRoptions"> <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> </div>
</div> </div>
......
...@@ -15,7 +15,8 @@ function initViveInterface(globals){ ...@@ -15,7 +15,8 @@ function initViveInterface(globals){
$status.html("No device connected."); $status.html("No device connected.");
$("#VRoptions").show(); $("#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); var controls = new THREE.VRControls(globals.threeView.camera);
controls.standing = true; controls.standing = true;
...@@ -41,7 +42,8 @@ function initViveInterface(globals){ ...@@ -41,7 +42,8 @@ function initViveInterface(globals){
if (!display) return; if (!display) return;
$status.html("VR device detected."); $status.html("VR device detected.");
var button = WEBVR.getButton( display, globals.threeView.renderer.domElement ); var button = WEBVR.getButton( display, globals.threeView.renderer.domElement );
document.body.appendChild(button); console.log(button);
$("#VRoptions").html(button);
var callback = button.onclick; var callback = button.onclick;
button.onclick = function () { button.onclick = function () {
globals.vrEnabled = !display.isPresenting; globals.vrEnabled = !display.isPresenting;
...@@ -55,9 +57,6 @@ function initViveInterface(globals){ ...@@ -55,9 +57,6 @@ function initViveInterface(globals){
} ); } );
} }
function disconnect(){
}
function render(){ function render(){
controller1.update(); controller1.update();
controller2.update(); controller2.update();
......
...@@ -17,6 +17,6 @@ $(function() { ...@@ -17,6 +17,6 @@ $(function() {
globals.staticSolver = initStaticSolver(globals); globals.staticSolver = initStaticSolver(globals);
globals.dynamicSolver = initDynamicSolver(globals); globals.dynamicSolver = initDynamicSolver(globals);
globals.pattern = initPattern(globals); globals.pattern = initPattern(globals);
// globals.vive = initViveInterface(globals); globals.vive = initViveInterface(globals);
$(".demo[data-url='Tessellations/waterbomb.svg']").click(); $(".demo[data-url='Tessellations/waterbomb.svg']").click();
}); });
\ No newline at end of file
...@@ -173,6 +173,7 @@ function initModel(globals){ ...@@ -173,6 +173,7 @@ function initModel(globals){
geometry.attributes.position.needsUpdate = true; geometry.attributes.position.needsUpdate = true;
if (globals.colorMode == "axialStrain") geometry.attributes.color.needsUpdate = true; if (globals.colorMode == "axialStrain") geometry.attributes.color.needsUpdate = true;
else geometry.computeVertexNormals(); else geometry.computeVertexNormals();
// if (globals.userInteractionEnabled) geometry.computeBoundingSphere();
// geometry.computeBoundingBox(); // geometry.computeBoundingBox();
// geometry.computeBoundingSphere(); // geometry.computeBoundingSphere();
} }
......
...@@ -6,7 +6,7 @@ var nodeMaterial = new THREE.MeshBasicMaterial({color: 0x000000, side:THREE.Doub ...@@ -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 nodeMaterialFixed = new THREE.MeshBasicMaterial({color: 0x000000, side:THREE.DoubleSide});
var nodeMaterialHighlight = new THREE.MeshBasicMaterial({color: 0xffffff, 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 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); nodeGeo.rotateX(Math.PI/2);
var nodeFixedGeo = new THREE.CubeGeometry(1, 1, 1); var nodeFixedGeo = new THREE.CubeGeometry(1, 1, 1);
nodeFixedGeo.applyMatrix( new THREE.Matrix4().makeTranslation(0, 0.25, 0) ); nodeFixedGeo.applyMatrix( new THREE.Matrix4().makeTranslation(0, 0.25, 0) );
......
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