Computing Technologies

What is the PHSSKAM file format?

It is quite simple:

Consider the following JointType array:


JointType[] orderdJointList ={JointType.HipCenter, JointType.Spine, JointType.ShoulderCenter, JointType.Head,
JointType.ShoulderLeft, JointType.ElbowLeft, JointType.WristLeft, JointType.HandLeft,
JointType.ShoulderRight, JointType.ElbowRight, JointType.WristRight, JointType.HandRight,
JointType.HipLeft, JointType.KneeLeft, JointType.AnkleLeft, JointType.FootLeft,
JointType.HipRight, JointType.KneeRight, JointType.AnkleRight, JointType.FootRight};

  • Every line is a skeleton position.
  • Every 3 values represent a Joint (e.g. -3.57943 0 179.9228 represent (X, Y, Z))
  • Every value is a coordinate 

Considering the following loops that read the file line by line, the first 60 values become the angles and the next 60 other values are the coordinates:

foreach (JointType joint in orderdJointList)
{
JointExtension j = new JointExtension();
j.JointType = joint;
j.AngleX = float.Parse(cells[k]);
j.AngleY = float.Parse(cells[k + 1]);
j.AngleZ = float.Parse(cells[k + 2]);
skeleton.joints[joint] = j;
k += 3;
}
foreach (JointType joint in orderdJointList)
{
JointExtension j = new JointExtension();
j.JointType = joint;
SkeletonPoint p = new SkeletonPoint();
p.X = float.Parse(cells[k]);
p.Y = float.Parse(cells[k + 1]);
p.Z = float.Parse(cells[k + 2]);
j.jointPoint.Position = p;
skeleton.joints[joint] = j;
k += 3;
}

You may notice that for the angles, the Y-Axis is always equal to 0, because we converting the coordinates to 2 angles, back and forth to apply the angles on a sample Skeleton, viewable in the ActionViewer.
© Copyright psaade.com 2017 | All rights reserved