Пример #1
0
        private void Window_Load(object sender, EventArgs e)
        {
            texture = ContentPipe.LoadTexture("explo.bmp");

            vertBuffer = new Vertex[0];
            VBO        = GL.GenBuffer();

            indexBuffer = new uint[0];
            IBO         = GL.GenBuffer();

            DEBUGvertBuffer = new Vertex[0];
            DEBUGVBO        = GL.GenBuffer();

            DEBUGindexBuffer = new uint[0];
            DEBUGIBO         = GL.GenBuffer();

            for (int i = 0; i < nmbrOfBoids / 2; i++)
            {
                boids.Add(new Boid(rand.Next(0, 1), new Vector2(200 + i * 5, 400),
                                   Vector2.Zero,
                                   10, 10,
                                   window.Width, window.Height, rand, 0.5 + rand.NextDouble(), 2 + rand.NextDouble(), 1 + rand.NextDouble(), 1 + rand.NextDouble()));
            }
            lastMS = Mouse.GetCursorState();
        }
Пример #2
0
        private void Window_Load(object sender, EventArgs e)
        {
            texture = ContentPipe.LoadTexture("explo.bmp");

            vertBuffer = new Vertex[0];
            VBO        = GL.GenBuffer();

            indexBuffer = new uint[0];
            IBO         = GL.GenBuffer();

            DEBUGvertBuffer = new Vertex[0];
            DEBUGVBO        = GL.GenBuffer();

            DEBUGindexBuffer = new uint[0];
            DEBUGIBO         = GL.GenBuffer();

            for (int i = 0; i < nmbrOfBoids / 2; i++)
            {
                boids.Add(new Boid(rand.Next(0, 1), new Vector2(200 + i, 200),
                                   Vector2.Transform(Vector2.UnitX, Quaternion.FromAxisAngle(new Vector3(0, 0, 1), (i * 360 / (nmbrOfBoids / 2)) % 360)),
                                   rand.Next(30, 60), rand.Next(10, 20),
                                   window.Width, window.Height, rand, 0.5 + rand.NextDouble(), 2 + rand.NextDouble(), 1 + rand.NextDouble(), 1 + rand.NextDouble()));
            }

            for (int i = (int)Math.Floor((double)nmbrOfBoids / 2); i < nmbrOfBoids; i++)
            {
                boids.Add(new Boid(1, new Vector2(1000 - i * 2, 400 - i),
                                   Vector2.Transform(Vector2.UnitX, Quaternion.FromAxisAngle(new Vector3(0, 0, 1), (i * 360 / (nmbrOfBoids / 2)) % 360)),
                                   rand.Next(30, 60), rand.Next(10, 20),
                                   window.Width, window.Height, rand, -1 + rand.NextDouble(), 2 + rand.NextDouble(), 1 + rand.NextDouble(), -1 + rand.NextDouble()));
            }
            lastMS = Mouse.GetCursorState();
        }