This project is read-only.
Add this code:
    // Add this in the LoadGraphicsContent method BEFORE your ModelAnimator has been created
    // but AFTER you have created your view and projection matrices
    Effect myEffect = content.Load<Effect>("MyPaletteEffect");
    foreach (ModelMesh mesh in model.Meshes)
    {
        for (int i = 0; i < mesh.MeshParts.Count; i++)
        {
            ModelMeshPart part = mesh.MeshParts[i];
            BasicPaletteEffect effect = (BasicPaletteEffect)part.Effect;

            part.Effect = myEffect.Clone(graphics.GraphicsDevice);
            part.Effect.Parameters["BasicTexture"].SetValue(effect.Texture);
            part.Effect.Parameters["View"].SetValue(view);
            part.Effect.Parameters["Projection"].SetValue(projection);
            effect.Dispose();
        }
    }


Running the program now will reveal the animated dwarf.

Last edited Mar 8, 2007 at 12:41 AM by dastle, version 5

Comments

No comments yet.