i have xna 3.1 how do i load multiple models in xna 3.1 for rendering either from array or button click or switches anything i just need to load multiple 3d models to render
this is the link
http://xboxforums.create.msdn.com/forums/p/15459/80961.aspx[
^]
where i get code but this code is in 4.0
Model[ ] modelArray;
protected override void LoadContent() {
modelArray = new Model[3];
modelArray[0] = Content.Load<Model>("model1");
modelArray[1] = Content.Load<Model>("model2");
modelArray[2] = Content.Load<Model>("model3");
}
protected override void Draw(GameTime time) {
GraphicsDevice.Clear(Color.LightBlue);
foreach (Model m in modelArray) {
foreach (BasicEffect be in m.Effects) {
be.World = YOURWORLDMATRIX;
be.View = YOURVIEWMATRIX;
be.Projection = YOURPROJECTIONMATRIX;
}
m.Draw();
}
base.Draw(time);
}
nd i have XNA 3.1 error occur in this line they show me error
ERROR1:'Microsoft.Xna.Framework.Graphics.Model' does not contain a definition for
'effects' and no extension method 'effects' accepting a first argument of type
'Microsoft.Xna.Framework.Graphics.Model' could be found (are you missing a
using directive or an assembly reference?)
AND ALSO SAME ERROR COME IN DRAW
'Microsoft.Xna.Framework.Graphics.Model' does not contain a definition for 'draw'
and no
extension method 'draw' accepting a first argument of type
'Microsoft.Xna.Framework.Graphics.Model' could be found (are you missing a using
directive or an assembly reference?)
in this lines
m.Effects
m.Draw();