I am trying to convert a 2D game to 3D and am having some trouble with textures. The whole game is made up of cubes so i'm using vertices to create a cube and calling it from the draw method. However I can only seem to colour all the cubes with one texture using the basic effect. I presume I need to use some other kind of effect so i can chose the texture for each cube but not really sure what to do. Any help is appreciated
Would be using a loop like the following to draw the cubes on screen. Somehow need the texture to be different for each cube
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
for (int i=0;i<mapsize;i++)
{
vertices = createCubeTexture(-1.0f, 0.5f);
device.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 2, VertexPositionTexture.VertexDeclaration);
}
}