I am trying to get some assets to display correctly in my game, but the best i can get is a gray box, the texture file is in the content directory but i have not added a reference in the content pipeline, is there anything wrong with my draw method?
private void DrawModel()
{
Matrix worldMatrix = Matrix.CreateScale(0.01f,0.01f, 0.01f);
Matrix[] Transforms = new Matrix[shipModel.Bones.Count];
shipModel.CopyAbsoluteBoneTransformsTo(Transforms);
foreach (ModelMesh mesh in shipModel.Meshes)
{
foreach (Effect currentEffect in mesh.Effects)
{
currentEffect.CurrentTechnique = currentEffect.Techniques["Textured];
currentEffect.Parameters["xTexture"].SetValue(logo);
currentEffect.Parameters["xWorld"].SetValue(Transforms[mesh.ParentBone.Index] * worldMatrix);
currentEffect.Parameters["xView"].SetValue(viewMatrix);
currentEffect.Parameters["xProjection"].SetValue(projectionMatrix);
currentEffect.Parameters["xEnableLighting"].SetValue(true);
currentEffect.Parameters["xLightDirection"].SetValue(lightDirection);
currentEffect.Parameters["xAmbient"].SetValue(0.5f);
}
mesh.Draw();
}
}