Multiple textures on a mesh created in blender and imported in xna
- by alecnash
I created a cube in blender which has multiple images applied to its faces. I am trying to import the model into xna and get the same results as shown when rendering the model in blender. I go through every mesh (for the cube its only one) and through every part but only the first image used in blender is displayed in every face. The code I am using to fetch the texture looks like that:
foreach (ModelMesh m in model.Meshes)
{
foreach (Effect e in m.Effects)
{
foreach (var part in m.MeshParts)
{
e.CurrentTechnique = e.Techniques["Lambert"];
e.Parameters["view"].SetValue(camera.viewMatrix);
e.Parameters["projection"].SetValue(camera.projectionMatrix);
e.Parameters["colorMap"].SetValue(modelTextures[part.GetHashCode()]);
}
}
m.Draw();
}
Am I missing something?