Kinect给我们内置了许多姿势如举手等,具体可参考枚举KinectGestures.Gestures,也可以通过Kinect姿势管理器,自定义姿势导入(坑较多,内置的基本够用了)也可以根据关节坐标自己程序定义姿势。本节主要讲解内置姿势使用。

此部分可参考插件场景KinectGesturesDemo1和KinectGesturesDemo2,使用内置姿势只需要在自己的脚本中实现接口ModelGestureListener : MonoBehaviour, KinectGestures.GestureListenerInterface即可。参考脚本ModelGestureListener和CubeGestureListener

接口方法:

1)public void UserDetected(long userId, int userIndex)

通过此方法来注册检测的姿势,即对要检测的姿势进行定义

2)public void UserLost(long userId, int userIndex)

UserDetected中通过userIndex定义的用户丢失时执行此方法

3)public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
                                  float progress, KinectInterop.JointType joint, Vector3 screenPos)

姿势进行时激发方法

4)public bool GestureCompleted (long userId, int userIndex, KinectGestures.Gestures gesture,
                                  KinectInterop.JointType joint, Vector3 screenPos)

当姿势完成时激活此方法

5)public bool GestureCancelled (long userId, int userIndex, KinectGestures.Gestures gesture,
                                  KinectInterop.JointType joint)
当取消时激活此方法

注:通过代码自定义姿势时可以采用获取到的关节点screenPos来进行匹配,也可以通过joint来获取joint实际位置进行判断

最新文章

  1. InfoCube信息立方体的优化
  2. RichTextBox着色与着色不闪
  3. Sql Server 基础知识
  4. java 后台校验格式
  5. ModelState用法
  6. table 添加右键,并获取选中行信息
  7. 武汉科技大学ACM :1008: 小t和小w
  8. myeclipse 配置weblogic 异常
  9. java对excel表格上传和下载的处理方法
  10. 实现点击页面其他地方,隐藏div(原生和VUE)
  11. jenkins 关闭和重启的实现
  12. BZOJ1179或洛谷3672 [APIO2009]抢掠计划
  13. 【大数据】Scala学习笔记
  14. win32 数据类型 vs c#
  15. Git----02本地仓库进行文件添加&修改&删除&查看
  16. OTL翻译(6) -- otl_connect类
  17. [OpenCV入门教程之十二】OpenCV边缘检测:Canny算子,Sobel算子,Laplace算子,Scharr滤波器合辑
  18. Elasticsearch之停用词
  19. 解决node-sass安装不了的问题
  20. Java 文件上传至leanCloud

热门文章

  1. Java行业未来发展
  2. Wordpress设置Pretty Permalink的方法
  3. 使用VirtualBox虚拟机搭建hadoop运行环境,
  4. flask+阿里云短信服务实现注册发送手机验证码
  5. Future类型的连锁的运用
  6. Spring Boot (十三): Spring Boot 整合 RabbitMQ
  7. 第二篇 python进阶
  8. Java对象是怎么创建的(通过对象的创建,了解JVM内存结构)
  9. 最简单的ArcGIS Engine应用程序(终)
  10. drf框架中jwt认证,以及自定义jwt认证