LeapMotion相关

官网地址:https://developer.leapmotion.com/get-started

官方Hand API:

https://developer.leapmotion.com/documentation/cpp/api/Leap.Hand.html#cppclass_leap_1_1_hand_1aa2c9cca797fde17bf7371451a297e608

API的解释以及翻译:http://blog.csdn.net/zmdsjtu/article/details/52668345

Magnetic Pinch

LeapMotion相关_第1张图片
Paste_Image.png

大概的一些手势识别方法与属性

using Leap;
using Leap.Unity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyHandConlltor : MonoBehaviour {

    Hand hand;
    GameObject obj;
    public GameObject Hands;
    // Use this for initialization
    void Start()
    {
        hand = GetComponent().GetLeapHand();
    }

    // Update is called once per frame
    void Update()
    {
        Debug.Log(hand.PalmPosition);//返回手腕重心点在LeapMotion坐标系里毫米单位的坐标
        Debug.Log(hand.PalmVelocity);//返回手掌的移动速度,单位:millimeters/second.
        Debug.Log(hand.PalmWidth);//当手面平整时估计手掌的宽度。单位是毫米
        Debug.Log(hand.Direction.Pitch); //向量类定义了俯仰Pitch旋转(围绕x轴旋转)范围大概在-1-1.8
        Debug.Log(hand.Direction.Yaw);//左右Yaw旋转(围绕y轴的旋转)范围大概在-2.4--0.05
        Debug.Log(hand.PalmNormal.Roll);//平面Roll旋转(围绕z轴旋转)
        Debug.Log(hand.Basis.xBasis);//小拇指的正方向
        Debug.Log(hand.Basis.yBasis);//手面向上的正方向
        Debug.Log(hand.Basis.zBasis);//手腕朝向的正方向
        if (hand.IsLeft)
        {//判断左右手
            Debug.Log("左手");
        }
        if (hand.GrabAngle > 3.14)
        {
            Debug.Log("紧握");
        }
        if (hand.GrabAngle < 0.5)
        {
            Debug.Log("松开");
        }
   }
}

你可能感兴趣的:(LeapMotion相关)