how i remove a 3D model of my game
this is my code
protected override void LoadContent()
{
arial16BMFont = Content.Load<SpriteFont>("Arial16");
// Load the model (by default the model is loaded with a BasicEffect. Use ModelContentReaderOptions to change the behavior at loading time.
models = new List<Model>();
foreach (var modelName in new[] { "Dude" })
{
model = Content.Load<Model>(modelName);
// Enable default lighting on model.
BasicEffect.EnableDefaultLighting(model, true);
models.Add(model);
}
model = models[0];
// Instantiate a SpriteBatch
spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice));
InitRes();
base.LoadContent();
// initialize the basic effect (shader) to draw the geometry, the BasicEffect class is similar to one from XNA
}
public override void Update(GameTime gameTime)
{
modelBounds = model.CalculateBounds();
// Calculates the world and the view based on the model size
const float MaxModelSize = 10.0f;
var scaling = MaxModelSize / modelBounds.Radius;
view = Matrix.LookAtRH(new Vector3(0, 0, MaxModelSize * 2.5f), new Vector3(2, -4, 0), Vector3.UnitY);
projection = Matrix.PerspectiveFovRH(0.9f, (float)GraphicsDevice.BackBuffer.Width / GraphicsDevice.BackBuffer.Height, 0.1f, MaxModelSize * 10.0f);
world = Matrix.Translation(-modelBounds.Center.X, -modelBounds.Center.Y, -modelBounds.Center.Z) * Matrix.Scaling(scaling); //* Matrix.RotationY((float)gameTime.TotalGameTime.TotalSeconds);
base.Update(gameTime);
// get the total elapsed seconds since the start of the game
}
public override void Draw(GameTime gameTime)
{
NeoManager.BeginDraw(gameTime);
GraphicsDevice.Clear(SharpDX.Color.CornflowerBlue);
model.Draw(GraphicsDevice, world, view, projection);
/* spriteBatch.Begin();
spriteBatch.DrawString(arial16BMFont, "Press the pointer to switch models...\r\nCurrent Model: " + model.Name, new Vector2(16, 16), Color.White);
spriteBatch.End();
*/
NeoManager.EndDraw();
base.Draw(gameTime);
SharpDX.Toolkit.Graphics.BlendState graphics = GraphicsDevice.BlendStates.Opaque;
SharpDX.Toolkit.Graphics.DepthStencilState graphics1 = GraphicsDevice.DepthStencilStates.Default;
}
return the previsious class it is a gamesystem show me the model but i don´t want it show it
this is the code
how i remove a 3D model of my game this is my code
return the previsious class it is a gamesystem show me the model but i don´t want it show it this is the code