How to use SkinnedEffect.SetBoneTransforms
I have a simple model th开发者_开发技巧at comes from Blender. It has one mesh and one armature. That armature has 3 bones in it.
When I load my model in XNA my model's bone collection has these bones:
0: RootNode
1: hankmesh
2: Armature
3: Bone 1
4: Bone 2
5: Bone 3
I am using the SkinnedEffect to deform the rendered model with the bones. I am trying to figure out what order I need to pass the transforms in to effect.SetBoneTransforms.
At first I figured the order would just match the model's bone order. That is if I wanted to transform bone 3 I could look up its index in the model and see that it is 5 and pass an array of transforms to .SetBoneTransforms with the 5th index having the transform I need.
However, from trial and error I have found that it is not the same index it is the index - 2. I am not sure what 2 represents here, or if I could always use that.
Can someone explain to me how to properly use .SetBoneTransforms on SkinnedEffect objects?
精彩评论