一、官方地址:
官网:https://www.ultraleap.com/
驱动下载:https://leap2.ultraleap.com/downloads/leap-motion-controller-2/
docs地址:https://docs.ultraleap.com/xr-and-tabletop/tabletop/unity/getting-started/index.html
unity开发地址(Demo下载):https://docs.ultraleap.com/xr-and-tabletop/tabletop/unity/getting-started/index.html
unity开发代码:https://docs.ultraleap.com/xr-and-tabletop/xr/unity/plugin/features/scripting-fundamentals.html
二、安装驱动
地址:https://www.sogou.com/tx?ie=utf-8&query=<%2Fb>&hdq=sogou-addr-cc9657884708170e&sourceid=6_01_03
这样说明已经安装成功
三、安装TouchFree
Ultraleap的TouchFree软件使用手部跟踪数据来生成屏幕光标,用户可以无接触地控制该光标。这种非接触式手势控制允许与信息亭和数字显示器进行简单、直观和卫生的交互。
- 下载
- 安装完成后,进行配置
- 根据设备安放情况,选择
- 接着,把手指悬空点在绿色的圈圈上,并按下空格,这里需要2次这样操作
- 配置完成,看到手指已经有光标跟随了,手指往前戳下,代表点击
- 在小图标上,点击Start TouchFree,这样功能就永久启动起来了
touchfree模式,不用要开发,就可实验手势点击功能,由官方直接提供
四、Unity安装LeapMotion插件
https://docs.ultraleap.com/xr-and-tabletop/tabletop/unity/getting-started/index.html
- 安装包(能科学上网,速度更快)
- 打开Capsule Hands场景进行测试
- 测试出来手掌就成功了
五、Unity安装LeapMotion最基础开发
1. 识别哪只手进入
- 新建一个场景 LeapMotion
- 建立一个Service Provider Desktop
- 建立一个LeapMotion的cs脚本
using UnityEngine;
using Leap;
public class LeapMotion : MonoBehaviour
{
public LeapProvider leapProvider;
private void OnEnable()
{
leapProvider.OnHandFound += OnHandFound;
leapProvider.OnHandLost += OnHandLost;
leapProvider.OnUpdateFrame += OnUpdateFrame;
}
private void OnDisable()
{
leapProvider.OnHandFound -= OnHandFound;
leapProvider.OnHandLost -= OnHandLost;
leapProvider.OnUpdateFrame -= OnUpdateFrame;
}
private void OnHandFound(Chirality hand)
{
if (hand == Chirality.Left)
{
Debug.Log("发现左手");
}
else if (hand == Chirality.Right) {
Debug.Log("发现右手");
}
}
private void OnHandLost(Chirality hand)
{
if (hand == Chirality.Left)
{
Debug.Log("左手消失");
}
else if (hand == Chirality.Right)
{
Debug.Log("右手消失");
}
}
void