带骨骼的XNA模型

带骨骼的XNA模型,xna,Xna,我在Blender中创建了一个模型,然后我用电枢创建了一些姿势。如何在XNA/MonoGame中显示此姿势?我找不到任何解决办法。我使用导出到fbx文件的模型。 我唯一的代码在这里,它绘制的模型没有电枢效应: protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); // Copy any parent tr

我在Blender中创建了一个模型,然后我用电枢创建了一些姿势。如何在XNA/MonoGame中显示此姿势?我找不到任何解决办法。我使用导出到fbx文件的模型。 我唯一的代码在这里,它绘制的模型没有电枢效应:

protected override void Draw(GameTime gameTime)
    {
        graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

        // Copy any parent transforms.
        Matrix[] transforms = new Matrix[myModel.Bones.Count];
        myModel.CopyAbsoluteBoneTransformsTo(transforms);

        // Draw the model. A model can have multiple meshes, so loop.
        foreach (ModelMesh mesh in myModel.Meshes)
        {
            // This is where the mesh orientation is set, as well as our camera and projection.
            foreach (BasicEffect effect in mesh.Effects)
            {
                effect.EnableDefaultLighting();
                effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateRotationY(modelRotation)
                    * Matrix.CreateTranslation(modelPosition);
                effect.View = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up);
                effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),
                    aspectRatio, 1.0f, 10000.0f);
            }
            // Draw the mesh, using the effects set above.
            mesh.Draw();
        }
        base.Draw(gameTime);
    }

这需要大量的工作,我怀疑是否有人愿意在帖子中写下来。此外,我甚至怀疑它是否适合一篇文章。但这里有一个链接将向您发送正确的方向:我正在尝试使用此链接,但在第AnimationClip=skiningdata.AnimationClips[Take 001]行中出现了一个异常;字典里没有Take 001键。有什么不对劲?我的模型有什么问题吗?正如错误消息所述,它无法在模型文件中检测到名为Take 001的动画剪辑。。。我不能告诉你为什么,但它就是这么说的。我猜是这个模型有问题。谢谢。现在它工作了。最后一个问题:我是否可以停止/暂停动画,并在没有电枢效果的情况下显示具有起始姿势的模型?