# Joint Distance to Floor Changes as I move!!!

• ### Question

• Hi,

I have sucessfully implemented the floor clip plane to measure the distance of left foot to the floor, which is fairly accurate. The problem I have is that as I move away from the camera (i.e. left foot Z angle is increase), the foot distance to the floor changes (increases).

Note: The floor itself is not tilted nor the Kinect stand.

here is the code:

```if (skeletonframe != null && skeleton.Joints != null)
{
float A = skeletonframe.FloorClipPlane.Item1;
float B = skeletonframe.FloorClipPlane.Item2;
float C = skeletonframe.FloorClipPlane.Item3;
float D = skeletonframe.FloorClipPlane.Item4;

//Calculate the distance from the floor
float point1 = A * (skeleton.Joints[JointType.FootLeft].Position.X);
float point2 = B * (skeleton.Joints[JointType.FootLeft].Position.Y);
float point3 = C * (skeleton.Joints[JointType.FootLeft].Position.Z);

float point1_d = A * A;
float point2_d = B * B;
float point3_d = C * C;

float numeratore = point1 + point2 + point3 + D;
float denominatore = point1_d + point2_d + point3_d;

distance = (numeratore / (float)System.Math.Sqrt(denominatore)) * 10;```

• Edited by Sunday, May 3, 2015 11:46 AM
Sunday, May 3, 2015 11:45 AM

### All replies

• Are you correcting the orientation of the body to account for the tilt and then taking your measurement. If the floorClipPlane value is changing, that is going to be an environmental issue since the data reflected back to the sensor is going to change since there is more data reflection off floors/walls and you are taking up less of the field of view.

Carmine Sirignano - MSFT

Friday, May 8, 2015 6:32 PM