So i'm trying to make a 3d game with 2d sprites. In blender I created a plane and used uv maps to map one of the sprites to the plane. When I push f12 and render the plane, the sprite is displayed.
I made sure to create a material for the plane and I made sure to add the texture as well as enabled uv mapping with the correct uv map.
I exported the file model as .fbx file and put this along with the texture image in the content folder of my project.
However when I render my model instead of the texture being displayed the plane is solid black.
What could be causing this? My draw looks like this:
public void Draw(Matrix View, Matrix Projection)
{
// Calculate the base transformation by combining
// translation, rotation, and scaling
Matrix baseWorld = Matrix.CreateScale(Scale)
* Matrix.CreateFromYawPitchRoll(
Rotation.Y, Rotation.X, Rotation.Z)
* Matrix.CreateTranslation(Position);
foreach (ModelMesh mesh in Model.Meshes)
{
Matrix localWorld = modelTransforms[mesh.ParentBone.Index]
* baseWorld;
foreach (ModelMeshPart meshPart in mesh.MeshParts)
{
BasicEffect effect = (BasicEffect)meshPart.Effect;
effect.World = localWorld;
effect.View = View;
effect.Projection = Projection;
effect.EnableDefaultLighting();
}
mesh.Draw();
}
}