Ammar Hassonjee – Project 05 – Wallpaper

Wallpaper Sketch

/* Ammar Hassonjee
   Section C
   ahassonj@andrew.cmu.edu
   Project 05 - Wallpaper
   */

function setup() {
    createCanvas(600, 600);
    background(0, 0 , 100);
}

function draw() {
    // First for loop that sets the y grid of elements
    for (var y = 0; y < 7; y++) {
        for (var x = 0; x < 7; x++) {
            //variables declared to alter shapes generated for wallpaper
            var ax = x * 100;
            var ay = y * 100;

            noStroke();
            // making sure the wallpaper is mirrored every other to create
            // continuous art effect
            if (x % 2 == 0) {
                // Making the quarter circle shapes
                fill(200);
                arc(ax, ay, 80, 80, radians(0), radians(90));
                arc(ax + 100, ay + 100, 80, 80, radians(180), radians(270));
                // Making triangle shape
                fill(255);
                triangle(ax + 90, ay + 10, ax + 25, ay + 60, ax + 35, ay + 70);
                // Making the circle shape
                fill(0);
                ellipse(ax + 30, ay + 65, 20, 20);
              }
            else {
                // Making the quarter circle shapes again but a different color
                fill(255, 245, 76);
                arc(ax + 100, ay, 80, 80, radians(90), radians(180));
                arc(ax, ay + 100, 80, 80, radians(270), radians(360));
                fill(0);
                triangle(ax + 10, ay + 10, ax + 75, ay + 60, ax + 65, ay + 70);
                // Making the circle shape but a different color
                fill(255);
                ellipse(ax + 70, ay + 65, 20, 20);
              }
            }
          }
}

My inspiration for this sketch came from trying to replicate a starry night. In my initial coding where I started to draw shapes and mirror them, I found that through alternating panel directions and by changing the colors of the same elements in each iteration of the loops, I could create an interesting drawing.

Author: Ammar Hassonjee

I am a third year architecture student.

Leave a Reply