سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top