From 21603db8eedb7c979ff83e97b900cd0ac221a1a5 Mon Sep 17 00:00:00 2001 From: Scott Byrns Date: Fri, 26 Dec 2014 00:37:42 -0700 Subject: [PATCH 1/8] holoide commit --- js/default.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/js/default.js b/js/default.js index df5d6b4..8b3f40f 100644 --- a/js/default.js +++ b/js/default.js @@ -52,21 +52,21 @@ function Init() { leap = new THREE.LeapMotion(); - leap.handleFrame = function ( frame ) { +// leap.handleFrame = function ( frame ) { - if ( frame.hasHandsVisible() ) { - if (frame.isCursorMode()) { +// if ( frame.hasHandsVisible() ) { +// if (frame.isCursorMode()) { -// frame.getDominantHand().fingers[0].tip.position.y -= 50; - sphere.position.set(frame.getDominantHand().fingers[0].tip.position.x, frame.getDominantHand().fingers[0].tip.position.y - 17.5, frame.getDominantHand().fingers[0].tip.position.z); - } - else { - frame.getDominantHand().palm.position.y -= 50; - sphere.position = frame.getDominantHand().palm.position;//.multiplyScalar( camera.position.z/500 ); - } - } -// renderer.render(scene, camera); - }; +// // frame.getDominantHand().fingers[0].tip.position.y -= 50; +// sphere.position.set(frame.getDominantHand().fingers[0].tip.position.x, frame.getDominantHand().fingers[0].tip.position.y - 17.5, frame.getDominantHand().fingers[0].tip.position.z); +// } +// else { +// frame.getDominantHand().palm.position.y -= 50; +// sphere.position = frame.getDominantHand().palm.position;//.multiplyScalar( camera.position.z/500 ); +// } +// } +// // renderer.render(scene, camera); +// }; //setup camera camera = new LeiaCamera({ @@ -141,6 +141,16 @@ function addObjectsToScene() { //Add your objects here UpateTimeObject(); LEIA_setBackgroundPlane('resource/brickwall_900x600_small.jpg'); + leap.handleFrame = function ( frame ) { + if ( frame.hasHandsVisible() ) { + // Update scene here. + var palmPosition = frame.getDominantHand().palm.position; + // myObject.position.set(palmPosition.x, palmPosition.y, palmPosition.z); +// console.log(palmPosition.z); + sphere.position.set(palmPosition.x/100, -palmPosition.z/100, (palmPosition.y/100) + 10); + } + }; + } function addLights() { From 589c8536aa2f8da47847ffc0631d2e9b52b0c328 Mon Sep 17 00:00:00 2001 From: Scott Byrns Date: Fri, 26 Dec 2014 00:37:43 -0700 Subject: [PATCH 2/8] holoide commit From d47c273b9e1e1788c7758ecb2edd076fba14be7d Mon Sep 17 00:00:00 2001 From: Scott Byrns Date: Fri, 26 Dec 2014 00:43:41 -0700 Subject: [PATCH 3/8] holoide commit --- js/default.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/default.js b/js/default.js index 8b3f40f..de92452 100644 --- a/js/default.js +++ b/js/default.js @@ -145,9 +145,12 @@ function addObjectsToScene() { if ( frame.hasHandsVisible() ) { // Update scene here. var palmPosition = frame.getDominantHand().palm.position; - // myObject.position.set(palmPosition.x, palmPosition.y, palmPosition.z); -// console.log(palmPosition.z); + var hand = frame.getDominantHand(); sphere.position.set(palmPosition.x/100, -palmPosition.z/100, (palmPosition.y/100) + 10); + + sphere.rotation.x = hand.roll; + sphere.rotation.y = hand.pitch; + sphere.rotation.z = hand.yaw; } }; From e74b443c72c70952389c7794306232b6622d3a83 Mon Sep 17 00:00:00 2001 From: Scott Byrns Date: Fri, 26 Dec 2014 00:43:41 -0700 Subject: [PATCH 4/8] holoide commit --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5aeee73..784f0cc 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@