I'm trying to simply get the direction of a swipe gesture with the Leap Motion using the javascript API. My code is:
$(document).ready(function() {
controller = new Leap.Controller("ws://localhost:6437/");
listener = new Leap.Listener();
listener.onFrame = function(controller) {
var frame = controller.frame();
var hands = frame.hands();
var pointables = frame.pointables();
var gestures = frame.gestures();
$("#rotationAxis").text(pointables.length);
$("#gestureDetected").text(gestures[0]);
}
controller.addListener(listener);
controller.enableGesture("swipe", true);
listener.onConnect = function(controller) {
// calibrate = new Leap.Calibrate(controller);
// calibrate.onComplete = function(screen){
// }
}
});
I can get the current gesture from the array, but cannot get the type or direction. Any ideas?
Thanks.