Example #1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     radio = 0.2f;
     GL.LoadIdentity();
     GL.MatrixMode(MatrixMode.Projection);
     GL.Ortho(0, 1, 0, 1, 0, 1);
     foco.valores(posx, posy, 0);
     for (int i = 0; i < 10000; i++)
     {
         punto[i] = new Punto();
         punto[i].valores(aleatorio.NextDouble(), aleatorio.NextDouble(), 0);
     }
 }
Example #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            radio = 0.2f;
            GL.LoadIdentity();
            GL.MatrixMode(MatrixMode.Projection);
            Matrix4 matriz = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1, 50.0f);

            GL.LoadMatrix(ref matriz);
            GL.Enable(EnableCap.DepthTest);

            foco.valores(0.5, 0.5, 0);
            vertices[0] = new Punto(); vertices[0].valores(-1f, -1f, 1f);
            vertices[1] = new Punto(); vertices[1].valores(-1f, 1f, 1f);
            vertices[2] = new Punto(); vertices[2].valores(-1f, -1f, -1f);
            vertices[3] = new Punto(); vertices[3].valores(-1f, 1f, -1F);
            vertices[4] = new Punto(); vertices[4].valores(1f, -1f, 1f);
            vertices[5] = new Punto(); vertices[5].valores(1f, 1f, 1f);
            vertices[6] = new Punto(); vertices[6].valores(1f, -1f, -1f);
            vertices[7] = new Punto(); vertices[7].valores(1f, 1f, -1F);
        }