0

Hey my problem is I have created the perfect model for what I want in 3dsMax I rigged a biped using the skin modifier,

I correctly positioned the envelopes and I animated the biped using frames and then exported as an .fbx and loaded it into XNA using the SkinnedModelPipeline.

Once Loaded into XNA the model deforms and it only seems to be on the models right arm.

As I'm only a new member I can't post images at this moment in time so I am sending a link to the images online.

3dsMax Model:

enter image description here

Model loaded in

enter image description here

Draw function for Models

//an array of the current positions of the model meshes
this.bones = animationPlayer.GetSkinTransforms();

for (int i = 0; i < bones.Length; i++)
{
       bones[i] *= Transform.World;                   
}

//remember we can move this code inside the first foreach loop below
//and use mesh.Name to change the textures applied during the effect
customEffect.CurrentTechnique = customEffect.Techniques[technique];
customEffect.Parameters["DiffuseMapTexture"].SetValue(diffuseMap);

customEffect.Parameters["Bones"].SetValue(bones);
customEffect.Parameters["View"].SetValue(Game.CameraManager.ActiveCamera.ViewProperties.View);
customEffect.Parameters["Projection"].SetValue(Game.CameraManager.ActiveCamera.ProjectionProperties.Projection);

foreach (ModelMesh mesh in model.Meshes)
{
    //move code above here to change textures and settings based on mesh.Name
    //e.g. if(mesh.Name.Equals("head"))
    //then set technique and all params

    foreach (ModelMeshPart part in mesh.MeshParts)
    {
        part.Effect = customEffect;
    }
    mesh.Draw();
}

I've goggled around for a long time and i cant find anything that would solve this problem.

Any help is appreciated.

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123

1 Answers1

0

When transforming bones you do not move them in 'world' space. They should inherit their parents transformation, so all bones has to be moved in relation to their parent.

Also issues with the scale\translation matrix in 3dsmax can cause similar looking issues. This can be checked for by re-importing the FBX back into 3dsmax, if it looks good after doing that then it's the issue is in the code.

IAmNoone
  • 1,011
  • 1
  • 8
  • 25
  • I took it back into max as an fbx so you are correct that it is the code. I asked a programmer and they told me to try this.... Try taking this model in with a world matrix that performs Translation only Scale only Rotatation only but im not fully sure what to do... – user3455015 Mar 25 '14 at 12:57
  • They might mean that you try with one type at at time, export one where you just translate the model, one where your rotate 1 bone , and one with scale - as 3 separate exports. – IAmNoone Mar 25 '14 at 13:04
  • Oh yeah i get you. I done that and still getting deformation. This really is going to be the death of me haha. So do you reckon that points to a max problem or definitely the code... – user3455015 Mar 25 '14 at 13:48
  • If you make them print out the rotation \ translation and so on then you can compare with what you have in max. Also maybe by creating a smaller 'rig' it's easier to debug, for example a cylinder with two bones only. then rotate the bone, export, and then see what's going on. – IAmNoone Mar 25 '14 at 13:59
  • yeah i get you thanks very much for the help man... Much appreciated. – user3455015 Mar 25 '14 at 14:12
  • No problem. I struggled a lot with the same thing one a few of my own projects which was bone related, so I'm glad I can help. Not much info around on what these issues are \ can be. Good luck! – IAmNoone Mar 25 '14 at 17:10