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 skToBeScaled.Joints[Head].Position.Y = skToBeScaled.Joints[Head].Position.Y + howMuchScaleToY skToBeScaled.Joints[Head].Position.Z = skToBeScaled.Joints[Head].Position.Z + howMuchScaleToZ
But this approach are not working