求大神!手势追踪源代码。
leapmotion吧
全部回复
仅看楼主
level 11
se78906 楼主
求大神分享一个Leapmotion 追踪手势的源代码,最好是ObjectC 的,只需要能追踪手势并且显示出来即可,谢谢!
2015年01月31日 19点01分 1
level 1
using UnityEngine;using System.Collections.Generic;using Leap;public class LeapBehavior : MonoBehaviour { LeapProvider provider; void Start () { provider = FindObjectOfType<LeapProvider>() as LeapProvider; } void Update () { Frame frame = provider.CurrentFrame; foreach (Hand hand in frame.Hands) { if (hand.IsLeft) { transform.position = hand.PalmPosition.ToVector3() + hand.PalmNormal.ToVector3() * (transform.localScale.y * .5f + .02f); transform.rotation = hand.Basis.Rotation(); } } }}
The script, LeapUnityExtensions.cs in Assets/LeapMotion/Scripts/Utils, provides helpful extension functions for converting vectors and matrices from the Leap Motion API classes to the Unity API classes. The functions ToVector3() and Rotation() used above are defined in this script.
Note: In almost every case, you should get Frame objects from the scene’s LeapProvider object. The LeapProvider transforms the frame data into the proper frame of reference. If you get a frame from the Leap.Controller object, the data will still be in the Leap Motion frame of reference and will not match the hands displayed in the scene.
2016年07月20日 07点07分 2
level 1
这个是官方的
2016年07月20日 07点07分 4
level 1
在UNITY 3D上用的
2016年07月20日 07点07分 5
1