如何在XNA中旋转静态模型?该模型被加载到一个名为“ModelManager”的单独类中:
我需要旋转名为'track_new'的模型,但它与其他模型一起存储。旋转是在'modelManager'类还是主'Game!.cs'文件下?
这是我的代码:
public class ModelManager : DrawableGameComponent
{
List<BasicModel> models = new List<BasicModel>();
public ModelManager(Game game) : base(game) { }
public override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
models.Add(new BasicModel(Game.Content.Load<Model>(@"Models\track_new")));
base.LoadContent();
}
public override void Update(GameTime gameTime)
{
for (int i = 0; i < models.Count; ++i)
models[i].Update();
base.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
foreach (BasicModel bm in models)
bm.Draw(((Game1)Game).camera);
base.Draw(gameTime);
}
}