Skip to content

Instantly share code, notes, and snippets.

@cdbkr
Created January 7, 2014 14:39
Show Gist options
  • Save cdbkr/8300215 to your computer and use it in GitHub Desktop.
Save cdbkr/8300215 to your computer and use it in GitHub Desktop.
controller.on('frame', function(frame){
data = frame;
if(data && data.hands.length > 0){
if(data.hands[0].palmPosition[1] < PALM_MAP_MOVE_THRESHOLD){
map.panBy(data.hands[0].palmPosition[0]/10,data.hands[0].palmPosition[2]/10);
}else if(data.hands[0].palmPosition[1] > PALM_MAP_TYPE_THRESHOLD){
checkFingers(data);
}
}
});
function checkFingers(frame){
switch(frame.pointables.length){
case 1:
map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
break;
case 2:
map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
break;
default:
break;
}
}
controller.connect();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment