Exemplo n.º 1
0
        private void glControl1_Paint(object sender, PaintEventArgs e)
        {
            Punto   A  = new Punto(-50.0, -50.0, 0.0);
            Punto   B  = new Punto(50.0, -50.0, 0.0);
            Punto   C  = new Punto(0.0, 50.0, 0.0);
            Cursor1 C1 = new Cursor1();

            C1.P.x    = 500.0;
            C1.P.y    = -500.0;
            C1.angulo = 0.0;
            Cursor1 C2 = new Cursor1();

            C2.P.x    = 0.0;
            C2.P.y    = 0.0;
            C2.angulo = (Math.PI / 3.0);
            Cursor1 C3 = new Cursor1();

            C3.P.x    = 600.0;
            C3.P.y    = 000.0;
            C3.angulo = (Math.PI / 3.0) * 2;
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            serp1(iteracion, C1, tamaño * 5); //Se incrementa el tamaño con cada iteración para que pueda ser visible

            glControl1.SwapBuffers();
        }
Exemplo n.º 2
0
 public void RefreshCusorPosition()
 {
     if (PosSelf)
     {
         PosSelf = false; return;
     }
     if (POS > -0.1)
     {
         Cursor1.CRPosition = POS / 1000;  Cursor1.RefreshPosition();
     }
 }
Exemplo n.º 3
0
        Cursor1 fM(int n, Cursor1 C, double L)
        {
            Cursor1 Cur = C;
            Punto   P1  = new Punto();

            if (n == 0)
            {
                P1.x = C.P.x + (L * Math.Cos(C.angulo));
                P1.y = C.P.y + (L * Math.Sin(C.angulo));
                GL.Begin(PrimitiveType.Lines);
                GL.Color3(Color.White);
                GL.Vertex2(C.P.x, C.P.y);
                GL.Vertex2(P1.x, P1.y);
                GL.End();
                Cur.P = P1;
            }
            else
            {
                Cur = fO(n - 1, Cur, L / 5.0);

                Cur.angulo += (Math.PI / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur         = fP(n - 1, Cur, L / 5.0);

                Cur.angulo -= (Math.PI / 5.0);
                Cur.angulo -= (Math.PI / 5.0);
                Cur.angulo -= (Math.PI / 5.0);
                Cur.angulo -= (Math.PI / 5.0);
                Cur         = fN(n - 1, Cur, L / 5.0);
                Cursor1 temp = Cur;
                Cur.angulo -= (Math.PI / 5.0);
                Cur         = fO(n - 1, Cur, L / 5.0);

                Cur.angulo -= (Math.PI / 5.0);
                Cur.angulo -= (Math.PI / 5.0);
                Cur.angulo -= (Math.PI / 5.0);
                Cur.angulo -= (Math.PI / 5.0);
                Cur         = fM(n - 1, Cur, L / 5.0);
                Cur         = temp;
                Cur.angulo += (Math.PI / 5.0);
                Cur.angulo += (Math.PI / 5.0);
            }
            return(Cur);
        }
Exemplo n.º 4
0
        Cursor1 fA(int n, Cursor1 C, double L)
        {
            Cursor1 Cur = C;
            Punto   P1  = new Punto();

            /*
             *
             *  P1.x = C.P.x + (L * Math.Cos(C.angulo));
             *  P1.y = C.P.y + (L * Math.Sin(C.angulo));
             *  GL.Begin(PrimitiveType.Lines);
             *  GL.Color3(Color.White);
             *  GL.Vertex2(C.P.x, C.P.y);
             *  GL.Vertex2(P1.x, P1.y);
             *  GL.End();
             *  Cur.P = P1;
             *
             */
            return(Cur);
        }
Exemplo n.º 5
0
        Cursor1 serp1(int n, Cursor1 C, double L)
        {
            Cursor1 Cur = C;

            Punto P1 = new Punto();

            if (n == 0)
            {
                P1.x = C.P.x + (L * Math.Cos(C.angulo));
                P1.y = C.P.y + (L * Math.Sin(C.angulo));
                GL.Begin(PrimitiveType.Lines);
                GL.Color3(Color.White);
                GL.Vertex2(C.P.x, C.P.y);
                GL.Vertex2(P1.x, P1.y);
                GL.End();
                Cur.P = P1;
            }
            else
            {
                // si falla deja de contar las A
                Cur         = fN(n - 1, Cur, L / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur         = fN(n - 1, Cur, L / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur         = fN(n - 1, Cur, L / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur         = fN(n - 1, Cur, L / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur.angulo += (Math.PI / 5.0);
                Cur         = fN(n - 1, Cur, L / 5.0);
            }
            return(Cur);
        }
Exemplo n.º 6
0
 private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e)
 {
     //Перемещаем курсор в точку клика на таймлайне
     Cursor1.SetPosition(0, e);
 }