官網(wǎng)地址:https://developer.leapmotion.com/get-started
官方Hand API:
API的解釋以及翻譯:http://blog.csdn.net/zmdsjtu/article/details/52668345
Magnetic Pinch
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<RigidHand>().GetLeapHand();
}
// Update is called once per frame
void Update()
{
Debug.Log(hand.PalmPosition);//返回手腕重心點(diǎn)在LeapMotion坐標(biāo)系里毫米單位的坐標(biāo)
Debug.Log(hand.PalmVelocity);//返回手掌的移動速度俏讹,單位:millimeters/second.
Debug.Log(hand.PalmWidth);//當(dāng)手面平整時估計手掌的寬度当宴。單位是毫米
Debug.Log(hand.Direction.Pitch); //向量類定義了俯仰Pitch旋轉(zhuǎn)(圍繞x軸旋轉(zhuǎn))范圍大概在-1-1.8
Debug.Log(hand.Direction.Yaw);//左右Yaw旋轉(zhuǎn)(圍繞y軸的旋轉(zhuǎn))范圍大概在-2.4--0.05
Debug.Log(hand.PalmNormal.Roll);//平面Roll旋轉(zhuǎn)(圍繞z軸旋轉(zhuǎn))
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("松開");
}
}
}