问题描述
Kinect的BoneOrientation类,能提供获取骨骼的旋转信息,但只能提供四元素的旋转数据。我打算获取胳膊的伸展角度信息,以下代码。foreach(BoneOrientationorientationinskeleton.BoneOrientations){if(orientation.StartJoint!=JointType.ShoulderRight)continue;//BoneRotationhierarchical=orientation.HierarchicalRotation;//Vector4quat=hierarchical.Quaternion;BoneRotationabsolute=orientation.AbsoluteRotation;Vector4quat=absolute.Quaternion;Console.WriteLine("Quaternion:"+quat.X+""+quat.Y+""+quat.Z+""+quat.W);}
打印出来的是一堆看不懂的四元素数据。Quaternion:0.82478860.54244430.015174120.1588949Quaternion:0.84353490.51869770.0007049450.1392876Quaternion:0.86293680.4913833-0.010001660.117399Quaternion:0.88369230.45914210.0022599830.09094723Quaternion:0.90337940.4235930.0088655270.06630217Quaternion:0.92263160.38329690.017488810.03909786Quaternion:0.94017830.33890410.028388720.02007205Quaternion:0.95134460.30593880.001798050.0366286Quaternion:0.923930.3309382-0.12369390.1467413Quaternion:0.91840780.3192938-0.18359220.1444734Quaternion:0.91592140.2891119-0.27200650.05928581Quaternion:-0.5815563-0.18051530.79156320.0513248Quaternion:0.74573470.1662152-0.6384997-0.09257665Quaternion:0.7998240.156258-0.5689551-0.1102499Quaternion:0.92542650.1187094-0.3266849-0.1508997
请教各位对Kinect体感开发的朋友,怎么把四元素的旋转量转换为欧拉角呢?
解决方案
本帖最后由 wutong07jbb 于 2015-10-30 18:23:15 编辑