protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
//Draw the model, a model can have multiple meshes, so loop
foreach (ModelMesh mesh in Ring.Meshes)
{
//This is where the mesh orientation is set, as well as our camera and projection
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = Matrix.Identity * Matrix.CreateRotationY( RingRotation )
* Matrix.CreateTranslation( RingPosition );
effect.View = Camera1.ViewMatrix;
effect.Projection = projectionMatrix;
}
//Draw the mesh, will use the effects set above.
mesh.Draw();
}
// Draw the sprite over the 3D object
spriteBatch.Begin( SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState );
explosion.DrawFrame( spriteBatch, explosionpos );
spriteBatch.End();
base.Draw( gameTime );
}