c# - Fbx Animated Model deforming when added to XNA -
hey problem have created perfect model want in 3dsmax rigged biped using skin modifier,
i correctly positioned envelopes , animated biped using frames , exported .fbx
, loaded xna using skinnedmodelpipeline
.
once loaded xna model deforms , seems on models right arm.
as i'm new member can't post images @ moment in time sending link images online.
3dsmax model:
model loaded in
draw function models
//an array of current positions of model meshes this.bones = animationplayer.getskintransforms(); (int = 0; < bones.length; i++) { bones[i] *= transform.world; } //remember can move code inside first foreach loop below //and use mesh.name change textures applied during 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 change textures , settings based on mesh.name //e.g. if(mesh.name.equals("head")) //then set technique , params foreach (modelmeshpart part in mesh.meshparts) { part.effect = customeffect; } mesh.draw(); }
i've goggled around long time , cant find solve problem.
any appreciated.
when transforming bones not move them in 'world' space. should inherit parents transformation, bones has moved in relation parent.
also issues scale\translation matrix in 3dsmax can cause similar looking issues. can checked re-importing fbx 3dsmax, if looks after doing it's issue in code.
Comments
Post a Comment