unity引擎怎么识别kinect手势识别算法挥动

unity与kinect之间的中间件怎么做?
按投票排序
不用自己做 官方assetstore里有很多kinect插件比如这个
这问题的答案应该可以google到。假如别人真做过的话, 除非把代码给你看,否则还是要你自己想。可以考虑的角度是:把kinect作为输入控制,鼠标的角色。unity3d 是否有相关的API?否则需要hack?
已有帐号?
无法登录?
社交帐号登录Kinect系统在Unity3D游戏角色动画制作中的应用--《电子技术与软件工程》2013年24期
Kinect系统在Unity3D游戏角色动画制作中的应用
【摘要】:针对传统游戏开发中角色动画制作成本高的问题,提出了一种利用Kinect系统结合iClone5的动作捕捉插件,实现真实人物动作捕捉,最终将所捕捉的动作数据输入到Unity3D游戏引擎中进行游戏动画开发的方法。实践表明,该方法能基本满足游戏角色动画制作需要,值得在Unity3D游戏开发中推广使用。
【作者单位】:
【关键词】:
【分类号】:TP317.4【正文快照】:
1引言在游戏开发中,游戏角色的动画制作一般通过动画制作软件如3DS Max将Bip骨骼与游戏人物模型绑定后,再逐步进行动画的调节,对制作人员技术水平要求相对较高,费时费力。随着动作捕捉技术的成熟,应用于电影特技的动作捕捉技术也被应用到游戏开发当中,通过这种技术,能极大的提
欢迎:、、)
支持CAJ、PDF文件格式,仅支持PDF格式
【相似文献】
中国期刊全文数据库
冯远淑,陈福民;[J];同济大学学报(自然科学版);2004年07期
邵未,张倩,孙守迁;[J];系统仿真学报;2003年03期
沈娟;李建微;;[J];计算机与数字工程;2008年03期
蔡群;吕俊;;[J];贵州大学学报(自然科学版);2009年04期
廖小兵;;[J];出版与印刷;2009年02期
张帆;;[J];软件导刊;2011年02期
李晓丹;肖明;曾莉;;[J];中国西部科技;2011年15期
李岩;董菲;;[J];山东体育学院学报;2008年09期
况奕;吴媛媛;鲁东明;;[J];计算机辅助设计与图形学学报;2006年08期
殷俊;张凯;崔晋;郑洁;;[J];江苏大学学报(自然科学版);2006年05期
中国重要会议论文全文数据库
易晓;秦圣峰;康金胜;;[A];第十届中国科协年会论文集(三)[C];2008年
中国博士学位论文全文数据库
马英红;[D];西安电子科技大学;2011年
邓利群;[D];中国科学技术大学;2012年
中国硕士学位论文全文数据库
徐捷;[D];浙江大学;2003年
况奕;[D];浙江大学;2006年
于明卓;[D];沈阳工业大学;2007年
刘剑锋;[D];浙江大学;2010年
沈晓杰;[D];浙江大学;2006年
张翔;[D];浙江大学;2010年
杨宏凯;[D];浙江大学;2007年
邢璐;[D];中国海洋大学;2009年
张东宁;[D];浙江大学;2011年
刘博;[D];北京理工大学;2011年
&快捷付款方式
&订购知网充值卡
400-819-9993
《中国学术期刊(光盘版)》电子杂志社有限公司
同方知网数字出版技术股份有限公司
地址:北京清华大学 84-48信箱 知识超市公司
出版物经营许可证 新出发京批字第直0595号
订购热线:400-819-82499
服务热线:010--
在线咨询:
传真:010-
京公网安备75号Kinect with Unity3D游戏开发的一点思路总结(体感赛车游戏)
发布时间: 10:25:26
Unity3D是一个非常成熟的3D引擎;Kinect可以理解为一个输入设备(像鼠标键盘一样)所以这里技术上的关键点是:将输入信号与3D图形控制结合起来
设计上的关键点是:构造正常人会在2—3平方米的面积内通常可以做的事情(比如让普通人在这个范围内挥动手臂切水果、罚点球、垫排球等等)
这些是笔者这几天接触Kinect with Unity3D以来的最大感受吧。(为什么使用Unity3D呢;因为它含有丰富的例程和已开发资源,所以初期适宜用来移植合适的游戏到Kinect上)
对于第二点,我想也是每一个Kinect人都在探索和寻找创意的;
而第一点,笔者刚玩这俩东西,稍稍分享一些思路。在Unity3D当中,笔者主要是利用了KinectPointController.cs这个官方提供的脚本。
这个脚本实现了识别全身各个关键部位,那么理论上我们只要将这些量通过某种转化关系之后,用来控制Unity3D已有的各个元素,就完成了任务。笔者因此进行了这方面的尝试,得益于Unity3D非常丰富的Sample,笔者选取官方的Car Tutorial进行改造。我们要做的就是根据识别部位的结果,将动作映射到汽车控制的指令,而后进行不断的测试和优化用户体验,即可。
笔者将KinectPointController.cs所挂的PointMan这个包挂在Car上,这样他们就可以一起移动,而后笔者目前只用到左右手、头和脚这几点,因此在unity中不显示PointMan的其他几点mesh。
在unity中通过KinectPointController.cs识别PointMan各点相对Car中心的坐标值,而后进行分析,笔者选取了若干个姿势,包括转方向盘,前倾踩油门和后倾踩刹车及挂倒档,通过试验正确识别后,下面剩下的就是模拟键盘鼠标控制Car的结果了。
在Car tutorial这个示例中,车子的油门和方向盘主要通过Car.js这个脚本中的throttle和steer来进行控制,而KinectPointController.cs是C#脚本,这就涉及C#对js中变量值的操作。Unity支持这样的操作。
笔者先将Car.js移到&Pro Standard Assets”目录下,然后修改上面两个变量为全局变量,而后直接可以在C#中调用Car.js的全局变量。为什么这样做可以参考官方文档:
因此再辅以对Unity3D图形界面下的若干设置和操作,就完成了目前的体感赛车demo,而剩下的就是根据用户体验对操控方式进行优化。
最后附上目前使用的修改后的KinectPointController.cs脚本,其中含有笔者目前对Car.js脚本中变量的操作方式
* KinectModelController.cs - Moves every 'bone' given to match
* the position of the corresponding bone given by
* the kinect. Useful for viewing the point tracking
* Developed by Peter Kinney -- 6/30/2011
* ____________________________________________
* Modified By Chen Zhehuai@Dian -- 11/2/2012
using UnityE
using System.C
public class KinectPointController : MonoBehaviour&
//Assignments for a bitmask to control which bones to look at and which to ignore
public enum BoneMask
None = 0x0,
Hip_Center = 0x1,
Spine = 0x2,
Shoulder_Center = 0x4,
Head = 0x8,
Shoulder_Left = 0x10,
Elbow_Left = 0x20,
Wrist_Left = 0x40,
Hand_Left = 0x80,
Shoulder_Right = 0x100,
Elbow_Right = 0x200,
Wrist_Right = 0x400,
Hand_Right = 0x800,
Hip_Left = 0x1000,
Knee_Left = 0x2000,
Ankle_Left = 0x4000,
Foot_Left = 0x8000,
Hip_Right = 0x10000,
Knee_Right = 0x20000,
Ankle_Right = 0x40000,
Foot_Right = 0x80000,
All = 0xFFFFF,
Torso = 0x10000F, //the leading bit is used to force the ordering in the editor
Left_Arm = 0x1000F0,
Right_Arm = 0x100F00,
Left_Leg = 0x10F000,
Right_Leg = 0x1F0000,
R_Arm_Chest = Right_Arm | Spine,
No_Feet = All & ~(Foot_Left | Foot_Right)
public SkeletonW
public GameObject Hip_C
public GameObject S
public GameObject Shoulder_C
public GameObject H
public GameObject Shoulder_L
public GameObject Elbow_L
public GameObject Wrist_L
public GameObject Hand_L
public GameObject Shoulder_R
public GameObject Elbow_R
public GameObject Wrist_R
public GameObject Hand_R
public GameObject Hip_L
public GameObject Knee_L
public GameObject Ankle_L
public GameObject Foot_L
public GameObject Hip_R
public GameObject Knee_R
public GameObject Ankle_R
public GameObject Foot_R
private GameObject[] _ //internal handle for the bones of the model
//private Vector4[] _boneP //internal handle for the bone positions from the kinect
public BoneMask Mask = BoneMask.A
// Use this for initialization
void Start () {
//store bones in a list for easier access
_bones = new GameObject[(int)Kinect.NuiSkeletonPositionIndex.Count] {Hip_Center, Spine, Shoulder_Center, Head,
Shoulder_Left, Elbow_Left, Wrist_Left, Hand_Left,
Shoulder_Right, Elbow_Right, Wrist_Right, Hand_Right,
Hip_Left, Knee_Left, Ankle_Left, Foot_Left,
Hip_Right, Knee_Right, Ankle_Right, Foot_Right};
//_bonePos = new Vector4[(int)BoneIndex.Num_Bones];
// Update is called once per frame
void Update () {
Vector3 leftHand = new Vector3(0,0,0);
Vector3 rightHand = new Vector3(0,0,0);
Vector3 HipCenter = new Vector3(0,0,0);
Vector3 HeadCenter = new Vector3(0,0,0);
Vector3 FootLeft = new Vector3(0,0,0);
Vector3 FootRight = new Vector3(0,0,0);
//update all of the bones positions
if (sw.pollSkeleton())
Debug.Log(&Has Track\n&);
for( int ii = 0; ii & (int)Kinect.NuiSkeletonPositionIndex.C ii++)&
//_bonePos[ii] = sw.getBonePos(ii);
if( ((uint)Mask & (uint)(1 && ii) ) & 0 ){
_bones[ii].transform.localPosition = sw.bonePos[player,ii];
//hip center
if(ii == 0)
HipCenter = _bones[ii].transform.localP
// Debug.Log(&Hip: x & + _bones[ii].transform.localPosition.x.ToString() + & y & +&
// _bones[ii].transform.localPosition.y.ToString() + & z & +_bones[ii].transform.localPosition.z.ToString());&
//head center
if(ii == 3)
HeadCenter = _bones[ii].transform.localP
// Debug.Log(&Head: x & + _bones[ii].transform.localPosition.x.ToString() + & y & +&
// _bones[ii].transform.localPosition.y.ToString() + & z & +_bones[ii].transform.localPosition.z.ToString());&
//foot left
if(ii == 15)
FootLeft = _bones[ii].transform.localP
// Debug.Log(&LeftFoot: x & + _bones[ii].transform.localPosition.x.ToString() + & y & +&
// _bones[ii].transform.localPosition.y.ToString() + & z & +_bones[ii].transform.localPosition.z.ToString());&
if(ii == 19)
FootRight = _bones[ii].transform.localP
// Debug.Log(&RightFoot: x & + _bones[ii].transform.localPosition.x.ToString() + & y & +&
// _bones[ii].transform.localPosition.y.ToString() + & z & +_bones[ii].transform.localPosition.z.ToString());&
//Right hand
if(ii == 11)
rightHand = _bones[ii].transform.localP
// Debug.Log(&RightHand: x & + _bones[ii].transform.localPosition.x.ToString() + & y & +&
// _bones[ii].transform.localPosition.y.ToString() + & z & +_bones[ii].transform.localPosition.z.ToString());&
//left hand
if(ii == 7)
leftHand = _bones[ii].transform.localP
// Debug.Log(&LeftHand: x & + _bones[ii].transform.localPosition.x.ToString() + & y & +&
// _bones[ii].transform.localPosition.y.ToString() + & z & +_bones[ii].transform.localPosition.z.ToString());
//Event.KeyboardEvent(&w&);
//Car.throttle = 0.5f;
//Car.throttle = 0;
//Car.steer = 0;
//left hand y+z &2 ;right hand y+z &2 右转
if ((leftHand.y + leftHand.z & 2) && (rightHand.y + leftHand.z & 2))
Car.steer = 1f;
//Car.throttle = 0.5f;
Debug.Log(&Right Turn\n&);
if ((leftHand.y + leftHand.z & 2) && (rightHand.y + leftHand.z & 2))
Car.steer = -1f;
//Car.throttle = 0.5f;
Debug.Log(&Left Turn\n&);
/* 倒车-》后倾;油门-》前倾 */
if ((HeadCenter.x & HipCenter.x + 0.06))
Debug.Log(&UPUP\n&);
Car.throttle = Car.throttle + 0.015f;
if (Car.throttle & 1)
Car.throttle = 1;
if ((HeadCenter.x & HipCenter.x) && (FootRight.x & HipCenter.x))
Debug.Log(&DOWNdown\n&);
Car.throttle = Car.throttle - 0.015f;
if (Car.throttle & -1)
Car.throttle = -1;
Debug.Log(&CS-thro & + Car.throttle);&
Debug.Log(&CS-stee & + Car.steer);&
Car.throttle = 0f;
Debug.Log(&Not Track--Down\n&);
来源:http://blog.csdn.net/a/article/details/您的位置: &
Kinect在Unity平台上的开发实例
优质期刊推荐

我要回帖

更多关于 kinect2.0 基本手势 的文章

 

随机推荐