简体   繁体   English

XNA认为它不包含任何网格,因此无法在屏幕上绘制模型

[英]XNA Fails To Draw Model On Screen Because It Thinks It Contains No Meshes

I created this simple rectangle model in Blender that is textured (1024 x 1024). 我在带有纹理(1024 x 1024)的Blender中创建了这个简单的矩形模型。 I loaded the model in XNA and it does not display on the screen. 我将模型加载到XNA中,并且它不显示在屏幕上。 I breakpointed on the model and the debug screen says it contains zero meshes which is not true, because I opened the model in Blender and it shows the mesh. 我在模型上断点了,调试屏幕上说它包含零个网格,这是不正确的,因为我在Blender中打开了模型并显示了网格。 There is a total of 1 meshes. 共有1个网格。 What could be wrong? 有什么事吗 Is it the code? 是代码吗? Or is it Blender? 还是Blender? I am new to 3D modeling. 我是3D建模的新手。 Here is the source code below: 这是下面的源代码:

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

            paddelloader1.World = Matrix.CreateTranslation(ballpos);
            paddelloader1.View = Matrix.CreateLookAt(new Vector3(0, 0, 10), new Vector3(0, 0, 0), Vector3.UnitY);
            paddelloader1.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), 800f / 480f, 0.1f, 100f);
            paddelloader1.Load();

            base.Draw(gameTime);
        } 

我通过在Blender中重新导出模型解决了该问题,并解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM