Take the 2-minute tour ×

I have several models here. When they stand still during gameTime, there's no flickering. But as soon as I move them across the x-axis, they flicker on some places.

protected override void Draw(GameTime gameTime)

    Matrix[] transforms = new Matrix[myModel.Bones.Count];

    foreach (ModelMesh mesh in myModel.Meshes)
        foreach (BasicEffect effect in mesh.Effects)
            effect.World = transforms[mesh.ParentBone.Index] * 
                * 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);

Why is that happening and what could I do to prevent it?

share|improve this question
Does the flickering look like Z-fighting? –  Andrew Russell Apr 30 '13 at 11:16
Probably something like that. When they are static the math turns out with the same results, once they move it flip flops between different states. It can be z-fighting or aliasing with different results. –  rioki Apr 30 '13 at 12:37
add comment

1 Answer

Issue was easy to solve:

My farPlane was too much (actually 10k). So I reduced that to 3k (according to my models) and also important is the nearPlane, which was at 0.1f. I changed that to 1 and now everything works!

share|improve this answer
add comment

Your Answer


