Note that there are some explanatory texts on larger screens.

plurals
  1. POKinect skeleton Scaling strange behaviour
    primarykey
    data
    text
    <p>I am trying to scale a skeleton to match to the sizes of another skeleton. My algoritm do the following:</p> <ul> <li>Find the distance between two joints of the origin skeleton and the destiny skeleton using phytagorean teorem</li> <li>divide this two distances to find a multiply factor.</li> <li>Multiply each joint by this factor.</li> </ul> <p>Here is my actual code:</p> <pre><code>public static Skeleton ScaleToMatch(this Skeleton skToBeScaled, Skeleton skDestiny) { Joint newJoint = new Joint(); double distanciaOrigem = 0; double distanciaDestino = 0; double fator = 1; SkeletonPoint pos = new SkeletonPoint(); foreach (BoneOrientation bo in skToBeScaled.BoneOrientations) { distanciaOrigem = FisioKinectCalcs.Distance3DBetweenJoint(skToBeScaled.Joints[bo.StartJoint], skToBeScaled.Joints[bo.EndJoint]); distanciaDestino = FisioKinectCalcs.Distance3DBetweenJoint(skDestiny.Joints[bo.StartJoint], skDestiny.Joints[bo.EndJoint]); if (distanciaOrigem &gt; 0 &amp;&amp; distanciaDestino &gt; 0) { fator = (distanciaDestino / distanciaOrigem); newJoint = skToBeScaled.Joints[bo.EndJoint]; // escaling only the end joint as the BoneOrientatios starts from HipCenter, i am scaling from center to edges. // applying the new values to the joint pos = new SkeletonPoint() { X = (float)(newJoint.Position.X * fator), Y = (float)(newJoint.Position.Y * fator), Z = (float)(newJoint.Position.Z * fator) }; newJoint.Position = pos; skToBeScaled.Joints[bo.EndJoint] = newJoint; } } return skToBeScaled; } </code></pre> <p>Every seems to work fine except for the hands and foots</p> <p>Look at this images</p> <p><img src="https://i.stack.imgur.com/q9uMG.jpg" alt="enter image description here"> <img src="https://i.stack.imgur.com/nj0Pu.jpg" alt="enter image description here"></p> <p>I have my own skeleton over me, and my skeleton scaled to the sizes of another person, but the hands and foots still crazy. (but code looks right)</p> <p>Any suggestion? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload