C#Xna 4.0 foreach循环3d模型未加载

时间:2014-09-22 20:24:11

标签: c# visual-studio-2010 3d game-development

我尝试使用foreach循环创建DrawModel方法:

void DrawModel(Model model, Vector3 modelPosition)
    {
        foreach (ModelMesh mesh in model.Meshes)
        {
            foreach (BasicEffect effect in mesh.Effects)
            {
                effect.LightingEnabled = true;
                effect.EnableDefaultLighting();
                effect.PreferPerPixelLighting = true;

                effect.World = Matrix.CreateTranslation(modelPosition);
                effect.Projection = cameraProjectionMatrix;
                effect.View = cameraViewMatrix;
            }
            mesh.Draw();
        }

    }

关于我缺少什么的任何想法?

0 个答案:

没有答案