0
votes

quite a confusing problem has struck me. After programming a fair bit of my game and it working correctly, i've come accross a model that won't show up in the level when i render it. I've tried scaling up, scaling down, rotating it, checking and double checking it's render matrix position and it just doesn't seem to render. I've implemented other models in exactly the same function and they render perfectly. I don't think there is an issue with the model though (by the way all my models are ".X" files), as the model appears perfectly when it is opened through DxViewer. So i am unsure as to what could be causing this issue to occur.

A sample of the temporary code i use to check how models will look in the game:

    static public void RenderTmp(Model model, float scale)
    {
        foreach (ModelMesh mesh in model.Meshes)
        {
            foreach (BasicEffect effect in mesh.Effects)
            {                                                              
                effect.PreferPerPixelLighting = true;

                effect.World = Matrix.CreateScale(scale) * Matrix.CreateTranslation(0, 0, 0);

                effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(90), Globals.g_Device.Viewport.AspectRatio, 1, 1000);
                effect.View = Matrix.CreateLookAt(new Vector3(0, 50, 0), new Vector3(0, 0, 0), Vector3.Forward);
            }
            mesh.Draw();
        }
    }

I now believe this may be an exporting issue from 3DS Max itself, I've checked the code over and over and i don't believe that is where the issue is.

2
can you post some code for us to have a look atharryovers
Hey guys, umm i'm fairly certain that normals are facing the correct way as it appears correct in DxViewer (is there any other way i could check the normals of the verts???). And yes the textures being used by the model are being compiled with the application (c# won't compile if it can't find the textures of a model).Ice Phoenix

2 Answers

0
votes

Are normals pointing the correct way? Are all textures used by the model compiled along with the application?

0
votes

I now believe this may be an exporting issue from 3DS Max itself, I've checked the code over and over and i don't believe that is where the issue is.

Thanks for your help Peter.