Hi! Back again!
So I'm trying to modify the onframe function to input the reel commands from here: http://test.vostrel.cz/jquery.reel/docs/jquery.reel.html (I may not even be choosing the right command here)
so the code is like so:
function onFrame(frame)
{
//console.log("Frame event for frame " + frame.id);
if(!isConnected || !frame.valid) return;
// Retrieves first hand - no need to get it by ID, since we're not fetching hand based time behaviour
if (frame.hands.length > 0) {
hand = frame.hands[0];
if (canDoGesture() && ExtendedFingersCount(hand) > 2) {
// retrieve velocity X
var velocityX = hand.palmVelocity[0];
// palmNormal[0] = roll
if (velocityX > 1000 && hand.palmNormal[0] > 0.2)
{
console.log("left to right");
lastSwipe = new Date();
reel.stepRight;
}
else if (velocityX < -1000 && hand.palmNormal[0] < -0.2)
{
console.log("right to left");
lastSwipe = new Date();
reel.stepLeft;
}
}
}
}
but I'm getting this error:
I've made sure that reel.js is included in the html so it should be defined