如何将关节位置映射到相同的骨架尺寸? [英] How to map joint positions to the same skeleton size?
问题描述
亲爱的所有人:
我想知道是否有一种简单的方法可以将关节位置(从kinect)映射到相同的骨架尺寸?众所周知,身体大小因用户而异。我想使用具有固定骨骼长度的骨架
来显示来自kinect的关节位置数据。这听起来像是在动画中重新定位。 有关于此的任何想法? 提前致谢!!
最好!
Leo
我会说它是更多重新缩放。
1)首先需要定义要用作基本参考的骨骼或元素。例如肩膀距离或头部到脊柱的距离。
2)然后,您需要计算缩放因子以将现有骨架转换为重新缩放的骨架。
float scalingFactor = shoulderDistance / targetShoulderDistance;3)最后你必须将此缩放应用于所有关节位置:
< pre class ="prettyprint"> foreach(在skeleton.Joints中联合关节)
{
joint.Position.X * = scalingFactor;
joint.Position.Y * = scalingFactor;
joint.Position.Z * = scalingFactor;
}
Dear all:
I wonder if there is a simple way to map the joint positions (from kinect) to the same skeleton size? As we know, the body size varies between different users. I want to visualize the joint position data from kinect using a skeleton with fixed bone length. It sounds like retargeting in animation. Any ideas about this? Thanks in advance!!
Best!
Leo
I would say it's more rescaling.
1) You first need to define which bones or elements you want to use as a base reference. For example shoulders distance or head to spine distance.
2) You then need to compute the scaling factor to convert the existing skeleton to rescaled skeleton.
float scalingFactor = shoulderDistance / targetShoulderDistance;3) and finally you must apply this scaling to all joint positions:
foreach (Joint joint in skeleton.Joints) { joint.Position.X *= scalingFactor; joint.Position.Y *= scalingFactor; joint.Position.Z *= scalingFactor; }
这篇关于如何将关节位置映射到相同的骨架尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!