无法将 .fbx 从搅拌机正确加载到 Monogame

Can’t Load .fbx from blender to Monogame correctly

我正在使用 pipeline.exe 工具,将我使用 Blender(使用默认的 Blender 2.73a 导出设置)制作的 .fbx 文件转换为 .xnb,然后 manually copy and paste it 在我的内容目录中(这是正确转换它的正确方法之一吗?)。

看完这个视频后 https://www.youtube.com/watch?v=u7tLYMPC828 我看到您必须将使用搅拌机创建的 .fbx 文件转换为 新的 .fbx 文件,使用名为 fbx converter 2013 的工具,然后在 pipeline.exe 工具中使用该文件来生成 最终 .xnb 文件。如果不这样做,在屏幕上绘制时我什至看不到我的模型。

通过我上面描述的步骤,我设法在我的屏幕上看到了 .xnb 文件,但它并不完全是我制作的原始模型。例如:

如你所见,我得到的真实模型(用 fbx converter 2013 转换后)要长得多,而左边的模型(我在游戏中绘制的模型)就像 装在一个小方块里

如果您使用的是 Blender,请告诉我如何将 .fbx 导入您的 Monogame 项目。 (或者你可以向我推荐你正在使用的另一个制作模型的软件,并告诉我你将模型导入Monogame的方法)

这是我绘制模型的方式:

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

    Vector3 modelPosition = new Vector3(-25, 0, 0);
    float modelRotation = 0;
    float aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;

    // Draw the model. A model can have multiple meshes, so loop.
    foreach (ModelMesh mesh in Brick.Meshes)
    {
        Vector3 cameraPosition = new Vector3(0.0f, 0.0f, 50.0f);
        foreach (BasicEffect effect in mesh.Effects)
        {
            effect.EnableDefaultLighting();
            effect.World = Matrix.CreateRotationZ(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);
}

编辑:我还尝试从搅拌机导出到 .X,当我转换为 .xnb、加载模型并绘制它时,没有任何显示。

好吧,我终于明白问题出在哪里了……我的绘图代码不正确。我尝试 https://msdn.microsoft.com/en-us/library/bb197293(v=xnagamestudio.31).aspx code from msdn website and it all worked out. I am stupid. Also, downloading https://msxna.codeplex.com/releases/view/117230 并以正确的顺序安装所有文件(按照 .txt 说明)修复了我遇到的无法创建项目的 monogame 内容项目错误 (error missing project subtype 6D335F3A-9D43-41b4-9D22-F6F17C4BE596),显然是因为我没有正确安装东西。