public void Draw(_Camera camera) { foreach (_Quad w in walls) { w.Draw(camera); } }
public void Update(_Camera camera) { distance = Vector3.Distance(camera.getPosition(), center); world = Matrix.Identity; world = Matrix.CreateRotationY(MathHelper.ToRadians(camera.getRotation().Y)); CreateTranslation(center.X, center.Y, center.Z); }
public void Draw(_Camera camera) { SelectionSort(billboards); for (int i = 0; i < billboards.Length; i++) { billboards[i].Draw(camera); } }
public void Draw(_Camera camera) { foreach (_Quad w in sides) { w.Draw(camera); } foreach (_Quad w in backHelixSides) { w.Draw(camera); } foreach (_Quad w in topHelixSides) { w.Draw(camera); } }
public virtual void Draw(_Camera camera) { if (multi >= 3 && !pode) { pode = true; } if (multi <= 0 && pode) { pode = false; } if (pode) { multi -= 0.003f; } else { multi += 0.003f; } this.device.SetVertexBuffer(this.buffer); //this.basicEffect.World = this.world; //this.basicEffect.View = camera.GetView(); //this.basicEffect.Projection = camera.GetProjection(); //this.basicEffect.TextureEnabled = true; //this.basicEffect.Texture = this.texture; this.effect.CurrentTechnique = this.effect.Techniques["Technique1"]; this.effect.Parameters["World"].SetValue(this.world); this.effect.Parameters["View"].SetValue(camera.GetView()); this.effect.Parameters["Projection"].SetValue(camera.GetProjection()); this.effect.Parameters["colorTexture"].SetValue(this.texture); this.effect.Parameters["colorTextureSnow"].SetValue(this.texture2); //this.effect.Parameters["multi"].SetValue(this.multi); foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); this.device.DrawUserPrimitives <VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length / 3); } }
protected override void Initialize() { this.world = Matrix.Identity; this.screen = _Screen.GetInstance(); this.screen.SetWidth(graphics.PreferredBackBufferWidth); this.screen.SetHeight(graphics.PreferredBackBufferHeight); this.camera = new _Camera(); this.ground = new _Quad(GraphicsDevice, this, Color.SaddleBrown, new Vector3(0, 0, 0), new Vector2(120, 120), _WallOrientation.Up); this.house = new _House(GraphicsDevice, this); this.helicopter = new _Helicopter(GraphicsDevice, this); base.Initialize(); }
public void Draw(_Camera camera) { this.effect.CurrentTechnique = this.effect.Techniques["Technique1"]; this.effect.Parameters["World"].SetValue(world); this.effect.Parameters["View"].SetValue(camera.GetView()); this.effect.Parameters["Projection"].SetValue(camera.GetProjection()); this.effect.Parameters["colorTexture"].SetValue(colorTexture); this.effect.Parameters["colorTextureSnow"].SetValue(colorTextureSnow); //this.effect.Parameters["t"].SetValue(time); foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); game.GraphicsDevice.DrawUserIndexedPrimitives <VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length, this.indices, 0, this.indices.Length / 3); } }
protected override void Initialize() { this.world = Matrix.Identity; this.screen = _Screen.GetInstance(); this.screen.SetWidth(graphics.PreferredBackBufferWidth); this.screen.SetHeight(graphics.PreferredBackBufferHeight); this.camera = new _Camera(); this.ground = new _Quad(GraphicsDevice, this, Color.SaddleBrown, new Vector3(0, 0, 0), new Vector2(70, 70), _WallOrientation.Up); //this.ground.CreateRotation("X", -90); this.house = new _House(GraphicsDevice, this, new Vector3(0, 0, 0), new Vector2(0, 0)); this.house1 = new _House(GraphicsDevice, this, new Vector3(-5, 0, 0), new Vector2(0, 0)); base.Initialize(); }
public virtual void Draw(_Camera camera) { this.device.SetVertexBuffer(this.buffer); this.effect.World = this.world; this.effect.View = camera.GetView(); this.effect.Projection = camera.GetProjection(); this.effect.TextureEnabled = true; this.effect.Texture = this.texture; foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); this.device.DrawUserPrimitives <VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length / 3); } }
protected override void Initialize() { this.world = Matrix.Identity; this.screen = _Screen.GetInstance(); this.screen.SetWidth(graphics.PreferredBackBufferWidth); this.screen.SetHeight(graphics.PreferredBackBufferHeight); this.camera = new _Camera(); this.ground = new _Quad(GraphicsDevice, this, @"Textures\ground", @"Textures\groundSnow", new Vector3(0, 0, 0), new Vector2(500, 500), _WallOrientation.Up); this.house = new _House(GraphicsDevice, this); this.helicopter = new _Helicopter(GraphicsDevice, this); this.highMap = new _HM(this, GraphicsDevice); base.Initialize(); }
public void Update(GameTime gameTime, _Camera camera) { foreach (_Billboard b in billboards) { b.Update(camera); } this.billboards[0].setCenter(new Vector3(55, 12, 3)); this.billboards[1].setCenter(new Vector3(-55, 12, 0)); this.billboards[2].setCenter(new Vector3(25, 12, -10)); this.billboards[4].setCenter(new Vector3(25, 12, 10)); this.billboards[8].setCenter(new Vector3(-3, 12, -55)); this.billboards[9].setCenter(new Vector3(5, 12, 25)); this.billboards[3].setCenter(new Vector3(-25, 12, -25)); this.billboards[5].setCenter(new Vector3(-25, 12, -10)); this.billboards[6].setCenter(new Vector3(-25, 12, 10)); this.billboards[7].setCenter(new Vector3(-25, 12, 25)); }
public virtual void Draw(_Camera camera) { this.device.SetVertexBuffer(this.vBuffer); this.effect.CurrentTechnique = this.effect.Techniques["Technique1"]; this.effect.Parameters["World"].SetValue(this.world); this.effect.Parameters["View"].SetValue(camera.GetView()); this.effect.Parameters["Projection"].SetValue(camera.GetProjection()); this.effect.Parameters["seaTexture"].SetValue(this.texture); this.effect.Parameters["time"].SetValue(this.time); foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); this.device.DrawUserIndexedPrimitives <VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length, this.indices, 0, this.indices.Length / 3); } }