控制3d模型Unity [英] controlling 3d Model Unity

查看:134
本文介绍了控制3d模型Unity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用kinect和unity制作一个avatering项目..我做这个项目但是有很多bug这是我的代码&b;
https://onedrive.live。 com / redir?resid = D9BB0505​​9EE90C1E!1200& authkey =!AG7Z-olhooV9zOY& ithint = file%2crar

我获取jointType kinect的位置并将其影响到我的模型骨骼 

i want to make an avatering project using kinect and unity .. i make this project but there is alot of bugs this is my code 
https://onedrive.live.com/redir?resid=D9BB05059EE90C1E!1200&authkey=!AG7Z-olhooV9zOY&ithint=file%2crar
im getting position of jointType kinect and affecting it to my models bone 

pos = body.Joints [Jt [i]]。位置;

pos = body.Joints[Jt[i]].Position;

  bones [i] .transform.position = new Vector3(pos.X,pos.Y,pos.Z);

  bones[i].transform.position = new Vector3(pos.X, pos.Y, pos.Z);

但这是结果  我不知道为什么会这样,我需要帮助

but this is the result i dont know why this happend , i need help

推荐答案

应用旋转的顺序很重要,因为有一个固有的层次结构会影响旋转如何影响树下面的关节位置。如果你只是应用肘部旋转,那应该应用于
网格的肩关节。 Kinect关节将具有适用于父关节的旋转。 y方向提供方向。

The order you apply the rotations will matter since there is an inherent hierarchy that will affect how that rotation affects the position of joints lower down the tree. If you just apply an elbow rotation, that should be applied to the shoulder joint of the mesh. The Kinect joint will have the rotation as it applies to the parent joint. The y direction provides the direction.

我们正在处理样本,因此您可以在此处查看预览。有一些错误,需要清理一些代码,但应该给你一些想法:

https://github.com/carmines/workshop/tree/dev/Unity/JointOrientationBasics

We are working on a sample, so you can have a look at a preview of it here. There are some bugs and need to clean up some code, but should give you some ideas: https://github.com/carmines/workshop/tree/dev/Unity/JointOrientationBasics


这篇关于控制3d模型Unity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆