• fullscreen
  • creative_challenge_II_pattern.pde
  • float baseAngle;
    
    void setup(){
      size(400,400);
      display();
    }
    
    void draw() {
    }
    
    void mouseClicked() {
      display();
    }
    void display() {
      pushMatrix();
      background(128);
      baseAngle=random(-PI/6);
      rotate(baseAngle);
      smooth();
      for (int i =-5;i<10;i++)
        for (int j=0;j<14;j++) {
          rect(i*width*.1,j*width*.1,width*.1,width*.1);
        }
      
      for(int i=0;i<6;i++) {
        int x=round(random(-3,8));
        int y=round(random(2,12));
        fill(0);
        rect(x*width*.1,y*width*.1,width*.1,width*.1);
      }  
      for(int i=0;i<6;i++) {
        pushMatrix();
        float px = random(0,width);
        float py = random(0,height);
        rotate(baseAngle+random(-PI/6,PI/6));
        fill(0);
        rect(px+width*.005,py+width*.005,width*.1,width*.1);
        fill(255);
        rect(px,py,width*.1,width*.1);
        popMatrix();
      }
      popMatrix();
    }
    

    code

    tweaks (0)

    about this sketch

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

    license

    advertisement

    Antonio J.S. Padial

    Creative Challenge II - Pattern

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

    This is a little exercise on pattern replicating a simple tile in a pair of embedded for loops.

    I added a little of life by removing (painting black) some of them, and addind some random tiles with a different angle.

    Click mouse to draw another design.

    Gorka Cortazar
    25 Jan 2011
    Great one Antonio! :)
    chris sugrue
    27 Jan 2011
    Nice work on this one! -- I like how simply changing the grid to be on an angle rather than inline with the window creates an immediate space and hints at depth.
    You need to login/register to comment.