Jamie Dorst Project 05 Wallpaper

sketch

/*
Jamie Dorst
jdorst@andrew.cmu.edu
Section A
Project-05
*/

var xPosition = -25;
var yPosition = -10;
var r = 133;
var g = 198;
var b = 199;

function setup() {
    createCanvas(600, 400);
    background(255);
}

function concentricCircle() {
    // draw concentric circles with diameter 50
    var diam = 50;
    // draw circles inside the previous circle until 0
    for(var i = 50; i > 0; i -= 10) {
        fill(r, g, b);
        ellipseMode(CENTER);
        ellipse(xPosition, yPosition, diam, diam);
        diam -= 10;
    }
}

function draw() {
    // make an offset grid of concentric circles
    for(var j = 0; j < 625; j += 50) {
        xPosition += 25;
        r += 5;
        g -= 2;
        for(var k = 0; k < 825; k += 50){
            concentricCircle()
            yPosition += 25;
            b -= 1;
        }
        yPosition = -10;
    }
}

This project was pretty cool once I started going. I drew inspiration from this picture, and the scale-like texture it has.

I had trouble figuring out how to get the for loops to work at first, but once I figured that out it went pretty smoothly. I took the concept from the lab this week of making a color gradient, and then also tried defining my own variable to actually make the concentric circles. Overall I’m happy with how it turned out, and I think I learned from this.

Leave a Reply