Commit 1e9c9734 authored by amandaghassaei's avatar amandaghassaei

vive controls

parent cf4c5810
...@@ -15,6 +15,12 @@ function initViveInterface(globals){ ...@@ -15,6 +15,12 @@ function initViveInterface(globals){
$status.html("No device connected."); $status.html("No device connected.");
$("#VRoptions").show(); $("#VRoptions").show();
WEBVR.getVRDisplay(function(display){
if (display) document.body.appendChild(WEBVR.getButton(display, globals.threeView.renderer.domElement));
$status.html("VR device detected.");
setup();
});
var controls, controller1, controller2, effect; var controls, controller1, controller2, effect;
var mesh = new THREE.Mesh(new THREE.CubeGeometry(1, 1,1 ), new THREE.MeshLambertMaterial({color:0xff0000})); var mesh = new THREE.Mesh(new THREE.CubeGeometry(1, 1,1 ), new THREE.MeshLambertMaterial({color:0xff0000}));
......
...@@ -35,12 +35,12 @@ function initPattern(globals){ ...@@ -35,12 +35,12 @@ function initPattern(globals){
var $outlines = $paths.filter(function(){ var $outlines = $paths.filter(function(){
var stroke = $(this).attr("stroke").toLowerCase(); var stroke = $(this).attr("stroke").toLowerCase();
return stroke == "#000000" || stroke == "#000"; return stroke == "#000000" || stroke == "#000" || stroke == "black";
}); });
var $mountains = $paths.filter(function(){ var $mountains = $paths.filter(function(){
var stroke = $(this).attr("stroke").toLowerCase(); var stroke = $(this).attr("stroke").toLowerCase();
if (stroke == "#ff0000" || stroke == "#f00" || stroke == "#FF0000" || stroke == "#F00"){ if (stroke == "#ff0000" || stroke == "#f00" || stroke == "#FF0000" || stroke == "#F00" || stroke == "red"){
var opacity = parseFloat($(this).attr("opacity")); var opacity = parseFloat($(this).attr("opacity"));
if (isNaN(opacity)) opacity = 1; if (isNaN(opacity)) opacity = 1;
_mountainAngles.push(opacity*Math.PI); _mountainAngles.push(opacity*Math.PI);
...@@ -51,7 +51,7 @@ function initPattern(globals){ ...@@ -51,7 +51,7 @@ function initPattern(globals){
var $valleys = $paths.filter(function(){ var $valleys = $paths.filter(function(){
var stroke = $(this).attr("stroke").toLowerCase(); var stroke = $(this).attr("stroke").toLowerCase();
if (stroke == "#0000ff" || stroke == "#00f" || stroke == "#0000FF" || stroke == "#00F"){ if (stroke == "#0000ff" || stroke == "#00f" || stroke == "#0000FF" || stroke == "#00F" || stroke == "greeen"){
var opacity = parseFloat($(this).attr("opacity")); var opacity = parseFloat($(this).attr("opacity"));
if (isNaN(opacity)) opacity = 1; if (isNaN(opacity)) opacity = 1;
_valleyAngles.push(-opacity*Math.PI); _valleyAngles.push(-opacity*Math.PI);
...@@ -62,12 +62,12 @@ function initPattern(globals){ ...@@ -62,12 +62,12 @@ function initPattern(globals){
var $cuts = $paths.filter(function(){ var $cuts = $paths.filter(function(){
var stroke = $(this).attr("stroke").toLowerCase(); var stroke = $(this).attr("stroke").toLowerCase();
return stroke == "#00ff00" || stroke == "#0f0"; return stroke == "#00ff00" || stroke == "#0f0" || stroke == "green";
}); });
var $triangulations = $paths.filter(function(){ var $triangulations = $paths.filter(function(){
var stroke = $(this).attr("stroke").toLowerCase(); var stroke = $(this).attr("stroke").toLowerCase();
return stroke == "#ffff00" || stroke == "#ff0" || stroke == "#FFFF00" || stroke == "#FF0"; return stroke == "#ffff00" || stroke == "#ff0" || stroke == "#FFFF00" || stroke == "#FF0" || stroke == "yellow";
}); });
parseSVG($outlines, $mountains, $valleys, $cuts, $triangulations, _mountainAngles, _valleyAngles); parseSVG($outlines, $mountains, $valleys, $cuts, $triangulations, _mountainAngles, _valleyAngles);
......
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