• fullscreen
  • mouseKeyboard.pde
  • objektsAroundCircleVertex.pde
  • visuals.pde
  • void mousePressed ()
    {
      redraw();
    }
    
    void keyPressed ()
    {
      if (keyCode == KeyEvent.VK_RIGHT)
      {
        actRandomSeed += 1;
        redraw ();
      }
      
        if (keyCode == KeyEvent.VK_LEFT)
      {
        actRandomSeed -= 1;
        redraw ();
      }
      
       //if (keyCode == KeyEvent.VK_S) saveFrame ("####.jpg");
    }
    
    int actRandomSeed = 4;
    
    void setup ()
    {
      size (700, 700);
      background (255);
      smooth();
      noLoop();
    }
    
    void draw ()
    {
      background (0);
      randomSeed (actRandomSeed);
      createRadius ();
      
    }
    
    
    
    void createRadius ()
    {
      int count = 0;
      int amount = 40;
      
      noFill ();
      
      while (count < amount)
      {
        
        float radius = random (60, height /2-30);
        float randomStrokeWeight = random (0.1,1);
        float a = 200-radius*0.80; // a = random (5, 80);
        a = constrain (a, 15, 170);
        
        stroke (255, a);
        strokeWeight (randomStrokeWeight);
        
        createDots (radius);
        count++;
      }
    }
    
    void createDots (float radius)
    {
      int centerX = width /2, centerY = height /2;
    
      int count = 0;
      int amount = int (radius/5);
    
      float steps = TWO_PI / amount;
      float angle = 0;
    
      beginShape ();
    
      while (count < amount)
      {
    
        float x = centerX + cos (angle) * radius;
        float y = centerY + sin (angle) * radius;
    
        vertex (x,y);
        createCurve (20, angle, steps, radius, centerX, centerY, 30);
    
    
        angle += steps;
        count++;
      }
    
      endShape ();
    }
    
    
    void createCurve (int amount, float angle, float steps,  float radius, int centerX, int centerY, int maxSpacing)
    {
      int count = 0;
      
      while (count < amount)
      {
        
        float randomX = random (-maxSpacing, maxSpacing);
        float randomY = random (-maxSpacing, maxSpacing);
        
        float randomAngleX = random (-steps, steps);
        float randomAngleY = random (-steps, steps);
        
        float x = centerX + cos (angle+randomAngleX) * (radius+randomX);
        float y = centerY + sin (angle+randomAngleY) * (radius+randomY);
        
        curveVertex (x,y);
        
        count++;
      }
    }
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Diana Lange

    objektsAroundCircle (hairy)

    Add to Faves Me Likey@! 10
    You must login/register to add this sketch to your favorites.

    Controls:

    right = next
    left = previous

    You need to login/register to comment.