• fullscreen
  • icmWeek2.pde
  • int strokeSize = 10;
    boolean first = true;
    float x;
    float y;
    float xCenter = 250;
    float yCenter = 250;
    float radius = 50;
    void setup()
    {
      size(500,500);
      background(52);
      frameRate(11);
    }
    
    void draw()
    {
      fill(52,10);
      rect(0,0,width,height);
      makeLines();
    }
    
    void makeLines()
    {
      strokeWeight(random(10));
      x = (cos(radians(random(360))) * radius) + xCenter;
      y = (sin(radians(random(360))) * radius) + yCenter;
      if(mousePressed == true){
        x = mouseX;
        y = mouseY;
      }
     // strokeWeight(strokeSize);
      stroke(255);
      line(x, y, xCenter, yCenter);
      xCenter = x;
      yCenter = y;
    }
    

    code

    tweaks (0)

    about this sketch

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

    license

    advertisement

    Matt Richard plus+

    TeamWork 1- drawing thingy

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

    Draws by itself, using the random() function.
    <br>
    Click to bring the focus back to the screen.
    <br>
    <A href="http://idblab.blogspot.com">Check out my blog</A>

    bil andersen
    24 Jun 2009
    Nice n Simple -- just what I need to learn from. Thanks Matt!
    You need to login/register to comment.