# Kinect skeleton scaling in 3d space

I am developing a physioterapy system with kinect and need to scale a skeleton size to another skeleton size.

The kinect sensor recognizes 20 body joints, of every joint i have the x, y, and z positions. So, lets say i have the point A(-2, 3, 4) and want to move this point to the location B(4, -5, 2)

Actualy, i am using phytagoras to get the distance between one pairs of the joints of the origin skeleton, and the DestinySkeleton. For example, lets try to scale the points between Head and shoulder center:

howMuchScaleToX = Math.Sqrt(Math.Pow((skToBeScaled.Joints[ShoulderCenter].Position.X - skDestiny.Joints[Head].Position.X), 2)) * -1;
howMuchScaleToY = Math.Sqrt(Math.Pow((skToBeScaled.Joints[ShoulderCenter].Position.Y - skDestiny.Joints[Head].Position.Y), 2)) * -1;
howMuchScaleToZ = Math.Sqrt(Math.Pow((skToBeScaled.Joints[ShoulderCenter].Position.Z - skDestiny.Joints[Head].Position.Z), 2)) * -1;


Now i think i have the distances to scale for each dimension (x, y, z). Now i just add this values to the skeleton to be scaled

skToBeScaled.Joints[Head].Position.X = skToBeScaled.Joints[Head].Position.X + howMuchScaleToX


But this approach are not working

-
Add $(6,-8,-2)$? Scale by $-2$ and then add $(0,1,10)$? There are infinitely many possibilities unless you explain more what you mean. – alex.jordan Nov 27 '12 at 5:28

Usually you would pick one point as the origin and measure all others relative to it. Then to scale, you just multiply all the coordinates by your scaling factor. So if the left foot is your origin, it is at $(0,0,0)$. Then if the original right ankle is at $(1,.2,.1)$ and you scale up by $1.2$ the new right ankle is at $(1.2,.24,.12)$. Is this at all what you mean?
@Ewerton: If you have measured corresponding points on the two objects, you can find a scale factor for each distance. That scale factor will simply be the ratio of the distances, which you can find from the Pythagorean theorem. It will reflect, for example, that one person's arms are longer relative to their legs than another. You still don't have separate factors in $x,y,z$-the length doesn't change if you bend an elbow, but the coordinates do. – Ross Millikan Nov 27 '12 at 15:11