您的位置:首页 > 移动开发 > Unity3D

【VR】Leap Motion 官网文档(二) Unity插件概述

2015-11-05 14:49 696 查看

Unity Plugin Overview(Unity插件概述)

The Leap Motion Controller tracks hands and fingers and reports position, velocity, and orientation with low latency and good accuracy. The controller can be used on a tabletop or mounted on a VR headset.(Leap Motion控制器追踪手和手指并且低延迟、高精度的返回它们的位置、速度和方向。Leap Motion控制器即可放在桌面上使用也可以安装在VR头盔上配合使用)The Leap Motion controller system consists of a hardware device and a software component which runs as a service or daemon on the host computer. The software component analyses images produced by the hardware and sends tracking information to applications.The Leap motion Unity plugin connects to this service to get data. Scripts included with the plugin translate Leap Motion coordinates to the Unity coordinate system. These scripts and additional graphic assets make it easy to add 3D, motion-controlled handsto a Unity scene.(Leap Motion控制器系统包括硬件设备和软件组件两个部分,并且软件组件以服务或者后台的方式在电脑上运行。软件组件负责由分析由硬件生成的图像信息,并且发送追中信息到应用程序中,Leap Motion的Unity插件与该服务建立链接并获取数据。这个Leap Motion的Unity插件中所包含的脚本能讲Leap Motion的坐标系【Leap Motion使用右手的坐标系】转换成Unity的坐标系【Unity使用左手坐标系】。通过这些脚本和附带的图形资源可以非常容易的把3D的手部模型控制器添加到Unity的场景中。)

Coordinate Systems(坐标系)

Unity3D uses a left-handed convention for its coordinate system, wheras the Leap Motion API uses a right-handed convention. (Essentially, the z-axis points in the opposite direction.) Unity also uses a default unit of meters, wheras the Leap Motion API usesmillimeters. The plugin scripts internally transforms the tracking data to use the left-handed coordinate system and scales distance values to meters.(Unity3D使用的是左手坐标系,而Leap Motion API 使用的是右手坐标系【本质上是Z轴的方向相反】。Unity中默认的单位是米,而Leap Motion API 中默认使用的是毫米。Unity插件中的脚本将追踪到的位置数据转换成左手坐标系的同时也对距离的值进行的缩放,从毫米缩放到米)The Unity left-handed coordinate system superimposed on the Leap Motion device in its desktop orientation.(Unity的左手坐标系在Leap Motion设备上的映射,当前是桌面的角度)The Unity coordinate system superimposed on the Leap Motion device in its HMD orientation.(Unity的左手坐标系在Leap Motion设备上的映射,当前是头戴设备角度)When you get tracking data directly from one of the classes in the Leap C# library, the data are in the native Leap coordinate system – not the Unity coordinate system. You can use the utility functions in the LeapUnityExtensions file to convert from LeapMotion coordinates to Unity coordinates.
ToUnity()
converts the axes from right-handed to left-handed and returns a Unity Vector3 object.
ToUnityScaled()
also scales the coordinates from milimeters to meters.
ToUnity() istypically used withdirection vectors;
ToUnityScaled()
with positions.(当你直接从Leap的C#类库中获取数据的时候,你得到的数据是Leap Motion的原始坐标系而并非转换后的Unity坐标系。你可以使用LeapUnityExtensions文件中的方法将Leap Motion的坐标系转换成Unity的坐标系。ToUnity()将右手轴转换成左手轴并返回一个Unity的Vector3类型的变量ToUnityScaled()这个方法可以将Leap Motion的毫米单位放大到米ToUnity()一般用于方向向量,ToUnityScaled()一般用于点)

Hand Tracking(手部跟踪)

The Leap Motion controller uses optical sensors and infrared light. The sensors have a field of view of about 150 degrees. The effective range of the Leap Motion Controller extends from approximately .03 to .6 meters above the device (1 inch to 2 feet).(Leap Motion控制器使用的是视觉感应器和红外心线光。视觉感应器的视野范围大约是150度左右。Leap Motion控制器的有效检测范围大概是0.03米到0.06米【1一尺到2英尺】)The Leap Motion controller’s view of your hands in desktop mode(Leap Motion控制器的手部视图【桌面模式】)Detection and tracking work best when the controller has a clear, high-contrast view of an object’s silhouette. The Leap Motion software combines its sensor data with an internal model of the human hand to help cope with challenging tracking conditions.(在Leap Motion控制器干净、物体轮廓清晰的情况下检测与追踪的效果最佳。Leap Motion软件将感应到的数据与内置的人物手部模型进行匹配,从而来应对多变的追踪情况)Particularly in HMD mode, you should ensure that there is less distance between the sensor and your hands then between your hands and any background objects or walls.(在头戴模式下特别需要注意的是,你的手与Leap Motion的距离应该小于你的手与任何背景物体或者墙的距离【译者注:上图背景物体为电脑显示器】)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: