public static void Draw(Camera3D camera)
        {
            foreach (Inimigo inimigoAtual in listaInimigos)
            {
                inimigoAtual.Draw(camera);

            }
        }
示例#2
0
        public Camera3D()
        {
            this.projection = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.PiOver4,
                Game1.self.GraphicsDevice.Viewport.AspectRatio,
                1f,
                50f);

            this.position = new Vector3(0, 50, -2);
            this.lookAt = new Vector3(0, 0, 0);

            self = this;
        }
示例#3
0
        public void Draw(Camera3D camera)
        {
            //modelo.Draw(worldMatrx, camera.View, camera.projecao);
            if (visible)
            {
                if (this is Tiro)
                {

                }

                if (this is Inimigo)
                {

                }

                foreach (ModelMesh malha in modelo.Meshes)
                {

                    foreach (BasicEffect efeito in malha.Effects)
                    {

                        efeito.World = worldMatrx;
                        efeito.View = camera.View;
                        efeito.Projection = camera.projection;
                        //basicEffect.Texture = textura;
                        //basicEffect.TextureEnabled = true;
                        efeito.EnableDefaultLighting();

                        //basicEffect.LightingEnabled = true;
                        //basicEffect.DirectionalLight0.DiffuseColor = new Vector3(0.5f, 0, 0);
                        //basicEffect.DirectionalLight0.Direction = new Vector3(1, 0, 0);
                        //basicEffect.DirectionalLight0.SpecularColor = new Vector3(0, 0, 1);

                        //basicEffect.AmbientLightColor = new Vector3(0.2f, 0.2f, 0.2f);
                        //efeito.EmissiveColor = Color.Yellow.ToVector3();

                        //basicEffect.DirectionalLight1.Enabled = true;
                        //basicEffect.DirectionalLight1.Direction = new Vector3(22, 11, 56);
                        //basicEffect.DirectionalLight1.SpecularColor = Color.Black.ToVector3();
                        //basicEffect.DirectionalLight1.DiffuseColor = Color.Yellow.ToVector3();

                        //basicEffect.DirectionalLight2.Enabled = true;
                        //basicEffect.DirectionalLight2.Direction = new Vector3(-22, -11, -56);
                        //basicEffect.DirectionalLight2.SpecularColor = Color.Green.ToVector3();
                        //basicEffect.DirectionalLight2.DiffuseColor = Color.Purple.ToVector3();

                        //basicEffect.AmbientLightColor = Color.Green.ToVector3();

                        //basicEffect.FogEnabled = true;
                        //basicEffect.FogColor = Color.Black.ToVector3();
                        //basicEffect.FogStart = 80;
                        //basicEffect.FogEnd = 300;

                        //basicEffect.EmissiveColor = Color.Purple.ToVector3();

                        //basicEffect.LightingEnabled = true;
                        //basicEffect.Alpha = 0.5f;

                        //subMalha.Effect = basicEffect;
                    }
                    malha.Draw();
                }
            }
        }
示例#4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            SceneManager.setScene(new Level());

            UIFont = Content.Load<SpriteFont>("Font1");

            SceneManager.setScene(new Menu());
            //InimigoManager.modeloDosInimigos = Content.Load<Model>("inimigo");

            //tiro = new Tiro(Content.Load<Model>("personagem"));

            camera = new Camera3D();
            camera.position.Z = 100;
            // TODO: use this.Content to load your game content here
        }