i tried it with the texture name. but then i get a nullreference exception. if i use a modell out of 3dws like the indoorframe1 i get the same error like mentioned above. usually i am doing sth. wrong. so i´ll write how i did it:
In 3dws on the right side in object categorie i choose house, under object i choose indoorframe1, under Texture Category i choose buildings and the i choose my own wood texture. then i export the object as .X file, because XNA wants this. In the .X file appears the brick. "error". when i write an other texture which exists and is in the same folder i get a nullreference exception at this line of code in the draw method():
for (int i = 0; i < level.Models.Length; i++)
{
Vector3 rotation = level.Models[i].rotation;
rotation *= MathHelper.Pi / 180f;
Matrix worldMatrix = Matrix.CreateFromAxisAngle(Vector3.Up, -MathHelper.PiOver2);
worldMatrix *= Matrix.CreateFromYawPitchRoll(rotation.Y, rotation.X, -rotation.Z);
worldMatrix.Translation = level.Models[i].position;
foreach (ModelMesh mesh in Models[i].Meshes)
{
foreach (Effect effect in mesh.Effects)
{
effect.Parameters["World"].SetValue(worldMatrix);
effect.Parameters["View"].SetValue(View);
effect.Parameters["Projection"].SetValue(Projection);
}
mesh.Draw();
}
}