first i create an array of models then i load the the models content location info
then i created each model to draw in the draw method.
however doing this simply is transforming the same model instead of drawing 10 seperate models
here is m code if anyone can figure it out
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
ContentManager content;
Model[] models;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
}
protected override void Initialize()
{ models = new Model[10];
base.Initialize();
}
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
for(int i=0;i<10;i++)
{
models

}
}
}
protected override void UnloadGraphicsContent(bool unloadAllContent)
{
if (unloadAllContent == true)
{
content.Unload();
}
}
protected override void Update(GameTime gameTime)
{
// Allows the default game to exit on Xbox 360 and Windows
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
foreach(Model mods in models)
{
LoadModel(mods);
objectPosition.X +=+2f;
}
base.Draw(gameTime);
}
Vector3 cameraPosition=new Vector3(0.0f,0.0f,2000.0f);
Vector3 cameraTarget = new Vector3(0.0f, 0.0f, 0.0f);
Vector3 cameraUP = Vector3.Up;
float FOV = MathHelper.ToRadians(45f);
float aspectRatio=640f/480f;
float clipNear=1.0f;
float clipFar=50000f;
Vector3 objectPosition = new Vector3(0.0f, 0.0f, 0.0f);
protected void LoadModel(Model model)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = Matrix.Identity * Matrix.CreateRotationX(45f) * Matrix.CreateTranslation(objectPosition);
effect.View = Matrix.CreateLookAt(cameraPosition, cameraTarget, cameraUP);
effect.Projection = Matrix.CreatePerspectiveFieldOfView(FOV, aspectRatio, clipNear, clipFar);
}
mesh.Draw();
}
}
}