Example #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //Inicializa o efeito
            efeito = new BasicEffect(GraphicsDevice);

            //Inicializa o gerador de números aleatórios
            random = new Random();

            //Inicializa a câmara
            Camera.Initialize(GraphicsDevice);

            //Gera a geometria do eixo 3D
            Create3DAxis.Initialize(GraphicsDevice);

            poligono = new Poligono(GraphicsDevice, 4);

            base.Initialize();
        }
Example #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //Inicializa o efeito
            efeito = new BasicEffect(GraphicsDevice);

            //Inicializa o gerador de números aleatórios
            random = new Random();

            //Inicializa a câmara
            Camera.Initialize(GraphicsDevice);

            //Gera a geometria do eixo 3D
            Create3DAxis.Initialize(GraphicsDevice);

            //Inicializa a lista de polígonos
            poligonos = new List<Poligono>();

            int contadorH = 0, contadorV = 0;
            //Gerar os polígonos e inseri-los numa lista
            for (int i = 3; i < 360; i++)
            {
                //if (360 % i == 0)
                {
                    Poligono pol = new Poligono(GraphicsDevice, random, i, new Vector3(-6 + (contadorH * 3), 0, -6 + (contadorV * 3)));
                    poligonos.Add(pol);
                    contadorH++;
                    if (contadorH >= 5)
                    {
                        contadorH = 0;
                        contadorV++;
                    }
                }
            }

            base.Initialize();
        }