kinect笔记 三、识别手型(手部位置和手势)

编程入门 行业动态 更新时间:2024-10-27 12:38:01

kinect笔记 三、识别手型(手部位置和<a href=https://www.elefans.com/category/jswz/34/1767590.html style=手势)"/>

kinect笔记 三、识别手型(手部位置和手势)

在unity中获取手的位置

创建一个空物体,命名为KinectManager,给该物体绑定上KinectManager 和 InteractionManager脚本

其中InteractionManager脚本上有三个纹理,Grip Hand Texture 是握拳,Release Hand Texture是手摊开的状态,Normal Hand Texture理论上应该是手呈半握状态并且其中的个别手指摊开,但是我从没有触发过

再新建一个空物体,命名为InteractionListener,新建一个脚本MyInteractionListener,这个脚本需要跟摄像机和InteractionManager相关联,但是InteractionManager可以用kinect的属性获取,所以只需要将摄像机拖拽到脚本上关联即可

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class MyInteractionListener : MonoBehaviour ,InteractionListenerInterface{[Tooltip("Camera used for screen ray-casting. This is usually the main camera.  用于屏幕光线投射的照相机。这通常是主相机。")]public Camera screenCamera;//[Tooltip("Interaction manager instance, used to detect hand interactions. If left empty, it will be the first interaction manager found in the scene.")][Tooltip("交互管理器实例,用于检测手交互。如果为空,它将是场景中发现的第一个交互管理器")]public InteractionManager interactionManager;// hand interaction variables   手的交互变量private InteractionManager.HandEventType lastHandEvent = InteractionManager.HandEventType.None;// normalized and pixel position of the cursor  鼠标光标的统一化和位置private Vector3 screenNormalPos = Vector3.zero;private Vector3 screenPixelPos = Vector3.zero;private Vector3 newObjectPos = Vector3.zero;/*[Tooltip("Minimum Z-position of the dragged object, when moving forward and back.")]public float minZ = 0f;[Tooltip("Maximum Z-position of the dragged object, when moving forward and back.")]public float maxZ = 5f;*//// <summary><

更多推荐

kinect笔记 三、识别手型(手部位置和手势)

本文发布于:2024-03-08 06:41:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1720090.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:手势   手部   位置   笔记   kinect

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!