Leap Motion
来源:互联网 发布:淘宝低价风险交易 编辑:程序博客网 时间:2024/03/29 23:24
1、坐标系
2、手
3、Fingers
4、Gestures 四种: Circle、Swipe、Key Tap、Screen Tap
1)Circle
属性:center、duration、handIds、id、normal、pointableIds、progress、radius、state、type
2) Swipe 多两个属性:speed 、startPosition
判断滑动方向:
var controllerOptions = {enableGestures: true};Leap.loop(controllerOptions, function(frame) { // Display Gesture object data if (frame.gestures.length > 0) { for (var i = 0; i < frame.gestures.length; i++) { var gesture = frame.gestures[i]; if(gesture.type == "swipe") { //Classify swipe as either horizontal or vertical var isHorizontal = Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[1]); //Classify as right-left or up-down if(isHorizontal){ if(gesture.direction[0] > 0){ swipeDirection = "right"; } else { swipeDirection = "left"; } } else { //vertical if(gesture.direction[1] > 0){ swipeDirection = "up"; } else { swipeDirection = "down"; } } console.log(swipeDirection) } } }});
3)Key Tap
4)Screen Tap
手势判断代码:
var controller = Leap.loop({enableGestures: true}, function(frame){ if(frame.valid && frame.gestures.length > 0){ frame.gestures.forEach(function(gesture){ switch (gesture.type){ case "circle": console.log("Circle Gesture"); break; case "keyTap": console.log("Key Tap Gesture"); break; case "screenTap": console.log("Screen Tap Gesture"); break; case "swipe": console.log("Swipe Gesture"); break; } }); }});
KeyTapGesture、ScreenTapGesture、SwipeGesture都拥有属性:
- duration
- handIds
- id
- pointableIds
- state
- type
- direction
- position
5、Motions:Scale、Rotation、Translation
Leap 可以根據每幀和前幀檢測到的數據,生成運動信息。例如,
若檢測到兩隻手,並且兩隻手都超一個方向移動,就認爲是平移;
若是像握着球一樣轉動,則記爲旋轉。
若兩隻手靠近或分開,則記爲縮放。
所生成的數據包含:
- 旋轉的軸向向量;
- 旋轉的角度(順時針爲正);
- 描述旋轉的矩陣;
- 縮放因子;
- 平移向量;
對於每隻手,可以檢測到如下信息:
- 手掌中心的位置(三維向量,相對於傳感器座標原點,毫米爲單位);
- 手掌移動的速度(毫米每秒);
- 手掌的法向量(垂直於手掌平面,從手心指向外);
- 手掌朝向的方向;
- 根據手掌彎曲的弧度確定的虛擬球體的中心;
- 根據手掌彎曲的弧度確定的虛擬球體的半徑;
当设备检测到手、手指、工具或者是手势的话,设备会赋予它一个唯一的ID号码作为标记,只要这个实体不出设备的可视区域,这个ID号就会一直不变,如果设备丢失这个实体之后又出现了,Leap 就会赋予它一个新的ID号码,但是软件不会知道这个和以前的那个实体有什么关系。
建议在Leap Motion Controller的视野中至多保留两只手,以获得最佳的运动跟踪质量。
阅读全文
0 0
- leap motion
- Leap Motion
- Leap Motion
- LEAP MOTION与MYO
- Leap Motion概述
- Leap Motion架构
- Leap Motion触摸仿真
- Leap Motion架构
- leap motion 系统简介
- Leap Motion架构
- Leap Motion 入门简介
- Unity集成Leap Motion
- 初识Leap motion
- Leap Motion 的原理
- Leap Motion 之 准备工作
- leap motion原理
- Leap Motion 的原理(转)
- Leap Motion用户体验指南
- bzoj
- 2017-8-5
- bzoj 4326 && Noip2015提高组运输计划
- 读取Spring配置文件ApplicationContext.xml的5种方法
- spring多环境变量配置 @profile
- Leap Motion
- 怎样选择适合的数据中心架构
- java基础知识汇总
- 研究表明DCIM可通过自动化节省成本
- Java 工程师成神之路
- java 做题小细节
- Difference Between HTM and HTML
- PackageManagerService安装APK流程
- 企业选择数据中心的五个重要因素