private void DrawRigidModel3(Model model, RigidAnimationPlayer rigidAnimationPlayer, RootAnimationPlayer rootAnimationPlayer) { RasterizerState rasterizerState = new RasterizerState(); rasterizerState.CullMode = CullMode.None; GraphicsDevice.RasterizerState = rasterizerState; Matrix rigidWorld = Matrix.CreateScale(1.5f, 1.5f, 1.5f) * Matrix.CreateRotationX(0) * Matrix.CreateTranslation(new Vector3(9, 0f, -30));//-0.05f //Matrix[] targetTransforms = new Matrix[model.Bones.Count]; //model.CopyAbsoluteBoneTransformsTo(targetTransforms); Matrix[] boneTransforms = null; if (rigidAnimationPlayer != null) boneTransforms = rigidAnimationPlayer.GetBoneTransforms(); Matrix rootTransform = Matrix.Identity; if (rootAnimationPlayer != null) rootTransform = rootAnimationPlayer.GetCurrentTransform(); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.View = viewMatrix; effect.Projection = projectionMatrix; // effect.World = rigidWorld; if (boneTransforms != null) effect.World = boneTransforms[mesh.ParentBone.Index] * rootTransform * rigidWorld; else effect.World = rootTransform * rigidWorld; } mesh.Draw(); } }