1 根据如下骨骼定义,编写一个txt文件,编写模型骨骼到标准骨骼的对应关系表,取名为,编号_bones_map.json
//
// 摘要:
// Human Body Bones.
public enum HumanBodyBones
{
//
// 摘要:
// This is the Hips bone.
// 这是臀部骨骼.
Hips = 0,//=Hips
//
// 摘要:
// This is the Left Upper Leg bone.
// 这是左大腿骨骼.
LeftUpperLeg = 1,
//
// 摘要:
// This is the Right Upper Leg bone.
// 这是右大腿骨骼.
RightUpperLeg = 2,
//
// 摘要:
// This is the Left Knee bone.
// 这是左膝盖骨骼.
LeftLowerLeg = 3,
//
// 摘要:
// This is the Right Knee bone.
// 这是右膝盖骨骼.
RightLowerLeg = 4,
//
// 摘要:
// This is the Left Ankle bone.
// 这是左脚踝骨骼.
LeftFoot = 5,
//
// 摘要:
// This is the Right Ankle bone.
// 这是右脚踝骨骼.
RightFoot = 6,
//
// 摘要:
// This is the first Spine bone.
// 这是脊柱骨骼.
Spine = 7,
//
// 摘要:
// This is the Chest bone.
// 这是胸部骨骼.
Chest = 8,
//
// 摘要:
// This is the Upper Chest bone.
// 这是上胸部骨骼.
UpperChest = 54,
//
// 摘要:
// This is the Neck bone.
// 这是脖子骨骼.
Neck = 9,
//
// 摘要:
// This is the Head bone.
// 这是头部骨骼.
Head = 10,
//
// 摘要:
// This is the Left Shoulder bone.
// 这是左肩膀骨骼.
LeftShoulder = 11,
//
// 摘要:
// This is the Right Shoulder bone.
// 这是右肩膀骨骼.
RightShoulder = 12,
//
// 摘要:
// This is the Left Upper Arm bone.
// 这是左上臂骨骼.
LeftUpperArm = 13,
//
// 摘要:
// This is the Right Upper Arm bone.
// 这是右上臂骨骼.
RightUpperArm = 14,
//
// 摘要:
// This is the Left Elbow bone.
// 这是左肘部骨骼.
LeftLowerArm = 15,
//
// 摘要:
// This is the Right Elbow bone.
// 这是右肘部骨骼.
RightLowerArm = 16,
//
// 摘要:
// This is the Left Wrist bone.
// 这是左手腕骨骼.
LeftHand = 17,
//
// 摘要:
// This is the Right Wrist bone.
// 这是右手腕骨骼.
RightHand = 18,
//
// 摘要:
// This is the Left Toes bone.
// 这是左脚趾骨骼.
LeftToes = 19,
//
// 摘要:
// This is the Right Toes bone.
// 这是右脚趾骨骼.
RightToes = 20,
//
// 摘要:
// This is the Left Eye bone.
// 这是左眼骨骼.
LeftEye = 21,
//
// 摘要:
// This is the Right Eye bone.
// 这是右眼骨骼.
RightEye = 22,
//
// 摘要:
// This is the Jaw bone.
// 这是下巴骨骼.
Jaw = 23,
//
// 摘要:
// This is the left thumb 1st phalange.
// 这是左拇指第一指骨.
LeftThumbProximal = 24,
//
// 摘要:
// This is the left thumb 2nd phalange.
// 这是左拇指第二指骨.
LeftThumbIntermediate = 25,
//
// 摘要:
// This is the left thumb 3rd phalange.
// 这是左拇指第三指骨.
LeftThumbDistal = 26,
//
// 摘要:
// This is the left index 1st phalange.
// 这是左食指第一指骨.
LeftIndexProximal = 27,
//
// 摘要:
// This is the left index 2nd phalange.
// 这是左食指第二指骨.
LeftIndexIntermediate = 28,
//
// 摘要:
// This is the left index 3rd phalange.
// 这是左食指第三指骨.
LeftIndexDistal = 29,
//
// 摘要:
// This is the left middle 1st phalange.
// 这是左中指第一指骨.
LeftMiddleProximal = 30,
//
// 摘要:
// This is the left middle 2nd phalange.
// 这是左中指第二指骨.
LeftMiddleIntermediate = 31,
//
// 摘要:
// This is the left middle 3rd phalange.
// 这是左中指第三指骨.
LeftMiddleDistal = 32,
//
// 摘要:
// This is the left ring 1st phalange.
// 这是左无名指第一指骨.
LeftRingProximal = 33,
//
// 摘要:
// This is the left ring 2nd phalange.
// 这是左无名指第二指骨.
LeftRingIntermediate = 34,
//
// 摘要:
// This is the left ring 3rd phalange.
// 这是左无名指第三指骨.
LeftRingDistal = 35,
//
// 摘要:
// This is the left little 1st phalange.
// 这是左小指第一指骨.
LeftLittleProximal = 36,
//
// 摘要:
// This is the left little 2nd phalange.
// 这是左小指第二指骨.
LeftLittleIntermediate = 37,
//
// 摘要:
// This is the left little 3rd phalange.
// 这是左小指第三指骨.
LeftLittleDistal = 38,
//
// 摘要:
// This is the right thumb 1st phalange.
// 这是右拇指第一指骨.
RightThumbProximal = 39,
//
// 摘要:
// This is the right thumb 2nd phalange.
// 这是右拇指第二指骨.
RightThumbIntermediate = 40,
//
// 摘要:
// This is the right thumb 3rd phalange.
// 这是右拇指第三指骨.
RightThumbDistal = 41,
//
// 摘要:
// This is the right index 1st phalange.
// 这是右食指第一指骨.
RightIndexProximal = 42,
//
// 摘要:
// This is the right index 2nd phalange.
// 这是右食指第二指骨.
RightIndexIntermediate = 43,
//
// 摘要:
// This is the right index 3rd phalange.
// 这是右食指第三指骨.
RightIndexDistal = 44,
//
// 摘要:
// This is the right middle 1st phalange.
// 这是右中指第一指骨.
RightMiddleProximal = 45,
//
// 摘要:
// This is the right middle 2nd phalange.
// 这是右中指第二指骨.
RightMiddleIntermediate = 46,
//
// 摘要:
// This is the right middle 3rd phalange.
// 这是右中指第三指骨.
RightMiddleDistal = 47,
//
// 摘要:
// This is the right ring 1st phalange.
// 这是右无名指第一指骨.
RightRingProximal = 48,
//
// 摘要:
// This is the right ring 2nd phalange.
// 这是右无名指第二指骨.
RightRingIntermediate = 49,
//
// 摘要:
// This is the right ring 3rd phalange.
// 这是右无名指第三指骨.
RightRingDistal = 50,
//
// 摘要:
// This is the right little 1st phalange.
// 这是右小指第一指骨.
RightLittleProximal = 51,
//
// 摘要:
// This is the right little 2nd phalange.
// 这是右小指第二指骨.
RightLittleIntermediate = 52,
//
// 摘要:
// This is the right little 3rd phalange.
// 这是右小指第三指骨.
RightLittleDistal = 53,
//
// 摘要:
// This is the Last bone index delimiter.
// 这是最后一个骨骼索引分隔符.
LastBone = 55
}
*/
映射如下:
public static Dictionary<string, HumanBodyBones> GetBoneMapping = new Dictionary<string, HumanBodyBones>
{
// 对应映射字典
{ “Hips”, HumanBodyBones.Hips },
{ “LeftUpLeg”, HumanBodyBones.LeftUpperLeg },
{ “LeftLeg”, HumanBodyBones.LeftLowerLeg },
{ “LeftFoot”, HumanBodyBones.LeftFoot },
{ “LeftToeBase”, HumanBodyBones.LeftToes },
{ “RightUpLeg”, HumanBodyBones.RightUpperLeg },
{ “RightLeg”, HumanBodyBones.RightLowerLeg },
{ “RightFoot”, HumanBodyBones.RightFoot },
{ “RightToeBase”, HumanBodyBones.RightToes },
{ “Spine”, HumanBodyBones.Spine },
{ “Spine1”, HumanBodyBones.Chest }, // Spine1 映射到 Chest
{ “Spine2”, HumanBodyBones.UpperChest }, // Spine2 映射到 UpperChest
{ “Neck”, HumanBodyBones.Neck },
{ “Head”, HumanBodyBones.Head },
{ “LeftEye”, HumanBodyBones.LeftEye },
{ “RightEye”, HumanBodyBones.RightEye },
{ “LeftShoulder”, HumanBodyBones.LeftShoulder },
{ “LeftArm”, HumanBodyBones.LeftUpperArm },
{ “LeftForeArm”, HumanBodyBones.LeftLowerArm },
{ “LeftHand”, HumanBodyBones.LeftHand },
{ “LeftHandIndex1”, HumanBodyBones.LeftIndexProximal },
{ “LeftHandIndex2”, HumanBodyBones.LeftIndexIntermediate },
{ “LeftHandIndex3”, HumanBodyBones.LeftIndexDistal },
{ “LeftHandMiddle1”, HumanBodyBones.LeftMiddleProximal },
{ “LeftHandMiddle2”, HumanBodyBones.LeftMiddleIntermediate },
{ “LeftHandMiddle3”, HumanBodyBones.LeftMiddleDistal },
{ “LeftHandPinky1”, HumanBodyBones.LeftLittleProximal },
{ “LeftHandPinky2”, HumanBodyBones.LeftLittleIntermediate },
{ “LeftHandPinky3”, HumanBodyBones.LeftLittleDistal },
{ “LeftHandRing1”, HumanBodyBones.LeftRingProximal },
{ “LeftHandRing2”, HumanBodyBones.LeftRingIntermediate },
{ “LeftHandRing3”, HumanBodyBones.LeftRingDistal },
{ “LeftHandThumb1”, HumanBodyBones.LeftThumbProximal },
{ “LeftHandThumb2”, HumanBodyBones.LeftThumbIntermediate },
{ “LeftHandThumb3”, HumanBodyBones.LeftThumbDistal },
{ “RightShoulder”, HumanBodyBones.RightShoulder },
{ “RightArm”, HumanBodyBones.RightUpperArm },
{ “RightForeArm”, HumanBodyBones.RightLowerArm },
{ “RightHand”, HumanBodyBones.RightHand },
{ “RightHandIndex1”, HumanBodyBones.RightIndexProximal },
{ “RightHandIndex2”, HumanBodyBones.RightIndexIntermediate },
{ “RightHandIndex3”, HumanBodyBones.RightIndexDistal },
{ “RightHandMiddle1”, HumanBodyBones.RightMiddleProximal },
{ “RightHandMiddle2”, HumanBodyBones.RightMiddleIntermediate },
{ “RightHandMiddle3”, HumanBodyBones.RightMiddleDistal },
{ “RightHandPinky1”, HumanBodyBones.RightLittleProximal },
{ “RightHandPinky2”, HumanBodyBones.RightLittleIntermediate },
{ “RightHandPinky3”, HumanBodyBones.RightLittleDistal },
{ “RightHandRing1”, HumanBodyBones.RightRingProximal },
{ “RightHandRing2”, HumanBodyBones.RightRingIntermediate },
{ “RightHandRing3”, HumanBodyBones.RightRingDistal },
{ “RightHandThumb1”, HumanBodyBones.RightThumbProximal },
{ “RightHandThumb2”, HumanBodyBones.RightThumbIntermediate },
{ “RightHandThumb3”, HumanBodyBones.RightThumbDistal }
};