Philip Gates – Project 05 – Wallpaper

sketch

var xSpacing = 125; //horizontal distance between elements
var ySpacing = 100; //vertical distance between elements

function setup() {
    createCanvas(500, 500);
}

function draw() {

    var stripeHeight = height/5; //set height of horizontal stripes

    //draw black stripes
    fill(0); 
    rect(0, 0, width, stripeHeight);
    rect(0, 2 * stripeHeight, width, stripeHeight);
    rect(0, 4 * stripeHeight, width, stripeHeight);

    //draw blue stripes
    fill("deepskyblue");
    rect(0, stripeHeight, width, stripeHeight);
    rect(0, 3 * stripeHeight, width, stripeHeight);

    for (var y=0; y<5; y++) { //create 5 rows

        //even rows: draw moon & stars
        if (isEven(y)) {   
        for (var x=0; x<4; x++) {   //draw 4 columns
            var i = (x * xSpacing) + 50;  
            var j = (y * ySpacing) + 50;  
            moon(i, j);   //draw 
            starCluster(i + 25, j - 25);
        }
        
        //odd rows: draw sun
        } else {  
            for (var x=0; x<4; x++) {
                var a = (x * xSpacing) + 75;
                var b = (y * ySpacing) + 50;
                sun (a, b);
            }
        }
    }
}


//creates moon
function moon (x,y) {
noStroke();
fill("lemonchiffon");
arc (x,y,50,50,HALF_PI,(PI * 3/2));
fill(0);
arc (x,y,25,50,HALF_PI,(PI * 3/2))
}

//creates three stars
function starCluster (x,y) {
fill(255);
text ("*",x,y);
text ("*",x+10,y+10);
text ("*",x-5,y+18);
}

//creates sun
function sun (x,y) {
    noStroke();
    fill("yellow");
    ellipse(x,y,30,30);
    for (var angle=0; angle < 360; angle +=45) {
        stroke("yellow");
        strokeWeight(2);
        line(x, y, x + cos(radians(angle)) * 30, y - sin(radians(angle)) * 30);
        }
}

//tests for odd/even
function isEven (value) {
    return value % 2 == 0;
}

I am not a visual artist/designer and not the best at drawing, so I skipped straight to brainstorming shapes in code. I knew I wanted to work with some curved shapes since I didn’t entirely master the arc() function earlier in the semester. Playing around with arcs in p5.js led me to the moon shape, which gave me the idea of alternating day/night sky patterns. This week’s lessons on cos() and sin() came in handy when I was trying to draw the sun’s rays, as I was able to use these functions to create a simpler way of creating the circular lines than drawing each individually.

Austin Treu – Project 05

atreu-proj-05

//Austin Treu
//atreu@andrew.cmu.edu
//Section B
//Project-05

function setup() {
   	createCanvas(580, 580);
    background(0,0,int(random(255)));

    //set vars for circles
    var tw = 20, th = 20, offset = 20, 
    	circSize = 10, loops = 10, 
		backX = ((loops-1) * tw)/2, backY = ((loops-1) * th)/2,
		backSize = loops*circSize, 
		tileSizeX = (loops) * tw, tileSizeY = (loops) * th,
		//randomize color
		colorRandom = int(random(255));
		backColor = 'rgb(100,0,'+colorRandom+')',
		circColor = 'rgb('+colorRandom+',0,200)',
		lineColor = 'rgb(200, 0,'+colorRandom+')';

	//loop to draw multiple tiles
	stroke(lineColor);
	for(var i = 0; i < (height/tileSizeY); i++){
		for(var j = 0; j < (width/tileSizeX); j++){
			//draw big background circle
			fill(backColor);
			ellipse(backX + j*tileSizeX, backY + i*tileSizeY, backSize, backSize);
			//utilize honeycomb pattern for tile
			fill(circColor);
		    for (var y = 0; y < loops; y++) {
		        for (var x = 0; x < loops; x++) {
		            if(y%2 === 0){
		                var py = ( (y * th)) + i * tileSizeY;
		                var px = ( (x * tw)) + j * tileSizeX;
		                ellipse(px, py, circSize, circSize);
		            }
		            else{      
		                var py = ( (y * th)) + i * tileSizeY;
		                var px = ( (0.5 * offset + x * tw)) + j * tileSizeX;
		                ellipse(px, py, circSize, circSize);          
		            }
		        }
		    }
		    //draw lines around each tile
		    line(j*tileSizeX, i*tileSizeY, (j+1)*tileSizeX, i*tileSizeY);
		    line((j+1)*tileSizeX + 0.5*offset, (i+1)*tileSizeY-th, j*tileSizeX + 0.5*offset, (i+1)*tileSizeY-th);
		    line(j*tileSizeX, i*tileSizeY, j*tileSizeX + 0.5*offset, (i+1)*tileSizeY-th);
		    line((j+1)*tileSizeX + 0.5*offset, (i+1)*tileSizeY-th, (j+1)*tileSizeX, i*tileSizeY);
		}
	}

    noLoop();
}


When I started working on this project, I wanted to use the honeycomb code from Assignment B this week because of how interesting that ended up looking by itself. Ultimately I had to simplify it in order to make the math for the rest of the design work out a bit better, as adjusting everything to deal with the square root of three over two can become a difficult task. The shapes’ randomized fills and stroke correspond with each other and utilize the same random value in different ways.

Lan Wei-Project-05-Wallpaper

my-sketch.js
>sketch

/* Lan Wei
Section D
lanw@andrew.cmu.edu
Project 05
*/

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

var gap = 20; //vertical distance between two waves
var dens = 20; //horizontal density of the waves
var waveRev = 4; // control how big the wave is

function draw(){
    //draw ocean
    var i = 0;
    for (var y = -gap; y < height - gap; y += gap){
        noFill();
        stroke(255);
        beginShape();
        i ++; //will be used for color setting
        for (var x = -50; x < width + 50; x += dens){
            y += random(-gap/waveRev , gap/waveRev );//wave
            curveVertex(x, y);
        }
        curveVertex(width, height);
        curveVertex(0, height);
        curveVertex(0, y - gap/waveRev);//just to find a point to close the shape
        var blue = map(y, 0, height, 255, 30);
        var green = map(y, 0, height, 220, 10);
        fill(50, green, blue);
        noStroke();
        endShape();
    }
    noLoop();
    drawFish();
}

//draw fish pattern
function drawFish(){
    var dist = 100; //horizontal distance between fish
    var level = 70; //vertical distance between fish
    i = 0;
    for (var x = dist; x < width; x += dist){
        i ++;
        if (i % 2 == 0){
            for (var y = level; y < height; y += level){
                fish(x, y);
            }
        }
        else{
            for (var y = level * 1/2; y < height; y += level){
                fish(x, y);
            }
        }
    }
}

//how the fish looks like
function fish(x, y){
    var fishW = 30;
    var fishH = 10;
    var tailL = 10;
    fill(240, 230, 140);
    ellipse(x, y, fishW, fishH);//body
    fill(0);
    ellipse(x-10, y, 5, 5);//eye-black part
    fill(255);
    ellipse(x - 9, y, 1.5, 1.5);//eye-white part
    fill(255, 215, 0);
    triangle(x + fishW/2, y, x + fishW/2 + tailL, y + 5, x + fishW/2 + tailL, y - 5);
    //tail
}

My initial idea was to create a scene of different depth of the ocean. I want to make the waves of some randomness and change the color to show depth difference. After I finished the waves, I added some fish to fulfill the project requirement, and surprisingly the effect is very good. What I feel the most helpful through the project is that I get  familiar with ‘helper functions’ and practiced to create shape with irregular curves.

The sketch I did before draw in P5.js
How the wallpaper looks on a hoody.

Julie Choi – Project 05 – Wallpaper

bubble wallpaper

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

function draw() {
    background(255);
    drawPatter(); //call function drawPatter
    noLoop(); 
}
function drawPatter() {
    // draw blue background line
    for(var i = 20; i < width; i += 60){
        strokeWeight(7);
        stroke(60, 211, 206, 50);
        line(i, 0, i, height);
    }
    // draw red background line
    for(var p = 10; p < width; p += 90){
        strokeWeight(3);
        stroke(255, 66, 0, 70);
        line(p, 0, p, height);
     }
    // draw the bubbles with ellipses with low opacity
    for (var y = 50; y < height + 50; y += 100) {
      for (var x = 50; x < width + 50; x += 100) {
          noStroke();
          var r = (y/200) * 255;
          var w = (x/200) * 255;

          fill(r / 32, w, 180, 50);
          ellipse(x, y, 30, 30);

          fill(134, w / 2, r, 50);
          ellipse(x + 18, y + 15, 30, 30);

          fill(r, w, 100, 50);
          ellipse(x + 18, y - 10, 30, 30);

          fill(r, w, 100, 50);
          ellipse(x + 10, y + 23, 20, 20);

          fill(r / 40, 0, 100, 50);
          ellipse(x + 10, y + 10, 10, 10);

          fill(r / 2, w, 100, 50);
          ellipse(x + 10, y + 10, 10, 10);

          fill(r, 0, 100, 50);
          ellipse(x + 30, y + 30, 50, 50);
      }
    }
}

I enjoyed this assignment because it really allowed me to be creative. My wallpaper is a pattern of colorful bubbles, and I was inspired by the old wallpaper I had as a child. Although it does not look similar to my actual wallpaper, I had fun making new designs from my memory.

Christine Chen-Project-05-Wallpaper

Christine Chen-Project-05-Wallpaper

/*
Christine Chen
Section E
cyc1@andrew.cmu.edu
Project-05-Wallpaper
*/

var x;
var y;
var offset = 10; //offset for left/right leaf positions

function setup() {
    createCanvas(600, 400);
    noStroke();
}
 
function draw() {
    background(255, 184, 214); //pink background
    polkaDots(); //dots for background
    fruit();
    noLoop(); 
}


function polkaDots(){ //background dots
    for (var y = 30; y < height; y += 120) {
        for (var x = 0; x < width + 100; x += 100) {
            fill(191, 212, 252); //light blue
            ellipse(x, y, 100, 100);
        }
    }
}

function fruit() {
    //odd row (bright pink peach)
    for (var y = 30; y < height; y += 120) { 
        for (var x = 50; x < width; x += 100) {
            //peach
            fill(255, 104, 168); //bright pink
            ellipse(x , y, 50, 50);

            //leaf
            fill(2, 133, 0); //dark green
            ellipse(x - offset - 4, y - 25, 30, 15); //left leaf
            ellipse(x + offset , y - 25, 20, 10); //right leaf
        }
    }

    //even row (dark pink peach)
    for (var y = 90; y < height; y += 120) { 
        for (var x = 100; x < width; x += 100) {
            //peach
            fill(220, 72, 134); //dark pink
            ellipse(x, y, 50, 50);

            //leaf
            fill(0, 217, 20); //bright green
            ellipse(x - offset - 4, y - 25, 30, 15); //left leaf
            ellipse(x + offset , y - 25, 20, 10); //right leaf
        }
    }
}







I had a lot of fun writing the codes for this project! Initially, I just wanted a simple wallpaper with repeating peaches. After I wrote the codes for that, I realized that it would be fun to have big repeating dots at the background that contrasts with the pink background. I also experimented with having gradients on the peaches using what I learned in recitation this week, but the results don’t look good, so I didn’t use that for the final.

Hand-drawn draft
Experiment with using gradient for pattern

Connor McGaffin – Project 05 – Wallpaper

sketch

/*
Connor McGaffin
Section C
cmcgaffi@andrew.cmu.edu
Project-05
*/
var ang = 120;

function setup() {
    createCanvas(600, 400);
    background(80,50,0);
    noStroke();

    //olive
    for(x=0; x<width; x+=50){
        for(j=0; j<height; j+=50){
            fill(100,70,0);
            ellipse(x+25,j+25,50,50);
        }
    }
    //pits
    for(x=0; x< width+50; x+=50){
        for(y=0; y<height; y+=50){
            stroke(60,0,0);
            strokeWeight(2);
            fill(85,0,0);
            ellipse (x-35, y+15, 15,15);

        }
    }
    //skewers
    for(x=0; x< width; x+=50){
        for(y=0; y<height; y+=50){
            fill(100,0,0);
            stroke(50,0,0);
            strokeWeight(2);
            line(x-7,y-7,x+15,y+15);
        }
    }
    //glass
    for(x=0; x<width; x+=100){
        for(y=0; y<width; y+=100){

            noStroke();
            fill('rgba(250, 250, 250, 0.6)');
            triangle(x+10,y+10,x+80,y+10,x+45,y+35);
            rect(x+42.5,y+33,5,45);
            triangle(x+10,y+10,x+80,y+10,x+45,y+35);
            triangle(x+20,y+83,x+70,y+83,x+45,y+75);
        }
    }
}




    

I created this pattern after being inspired by the art deco visuals of AMC’s “Mad Men”. I had fun finding a way to visualize the olives while still speaking to the visual aesthetic of the 1960’s era. Initially, I approached the olives in an projected view, but they were indistinguishable from everyday beads. When rotating the olives to a 3/4 view from above, an interesting sense of space is established. The choice to connect all of the olives on the same skewer creates a surreal atmosphere to the environment, which speaks to the inability to place where this pattern is located when viewed on a screen.

I would anticipate that this pattern could potentially be used in a restaurant. It’s fun but also a little gaudy, so it would likely go in there bathroom, rather than the front lobby.

Rachel Lee Project 05 Section E

sketch

/* Rachel Lee
Section E
rwlee@andrew.cmu.edu
Project 05
*/


var spacing = 80; // spacing between elements
var kiwiSize = 60;

function setup() {
    createCanvas(480, 480);
    background(255, 210, 225);

    // drawing kiwi
    for (var x = 75; x < width - 75; x += spacing) { // width of rows
        for (var y = 85; y < height - 85; y += spacing * 1.2) { // length of columns
            noStroke();
     // brown kiwi skin
            fill(165, 115, 65);
            ellipse(x, y, kiwiSize, kiwiSize);
   
    // green kiwi flesh
            fill(190, 215, 90);
            ellipse(x, y, kiwiSize * 0.9, kiwiSize * 0.9);

    // beige kiwi core
            fill(240, 240, 205);
            ellipse(x, y, kiwiSize * 0.5, kiwiSize * 0.5);
    
    // kiwi seeds
            fill(0);
            ellipse(x - 15, y, 3, 3);
            ellipse(x + 15, y, 3, 3);
            ellipse(x, y - 15, 3, 3);
            ellipse(x, y + 15, 3, 3);
        }
    } 

    // text that aligns with kiwi
    for (var a = 45; a < width - 75; a += spacing) {
    	for (var b = 105; b < height - 85; b += spacing * 0.9) {
            fill(40, 140, 70);
            textSize(9);
            textFont('Akkurat Mono');
            text("kiwi dreams", a, b * 1.3);    
    	}
    }
    noLoop(); // drawing only once
}


function draw() {

}



I decided to base my wallpaper on my current favourite fruit, the kiwi. I wanted to incorporate more playful colors as well as a dreamier caption, since it is turning cold in Pittsburgh and I miss warm weather. I was inspired by a cherry printed shirt I came across when I was online shopping, and numerous fruit illustrations I found on Pinterest (such as this pomegranate one). Overall, it was really fun playing with symmetry and pattern, and I would like to continue this project to perhaps feature alternating sliced and whole kiwis.

Pomegranate pattern I took inspiration from
Cherry shirt I came across when online shopping

Anthony Ra – Project 05 – Wallpaper

sketch

/* Anthony Ra
Section-A
ahra@andrew.cmu.edu
project-05 */

function setup() {
    createCanvas(640, 400);
    background(235, 205, 255);
    var varWidth = 100;
    var varHeight = 60;
    var starty = 0;
    var startx = 0;

    for (var y = 0; y < 10; y++) {
        for (var x = 0; x < 18; x++) {
            var py = starty + y * varHeight;
            var px = startx + x * varWidth;
      /* moving cube to just the right */
            if (y%2 == 0) {
              px = (startx - 25) + x * varWidth;
            }
            else {
              px = startx + x * varWidth;
            }
            noStroke();
          /* top of the cube */
            fill(255, 205, 235);
            quad(px, py, px + 25, py - 15, px + 50, py, px + 25, py + 15);
            fill(255, 230, 255);
            quad(px + 5, py, px + 25, py - 12, px + 45, py, px + 25, py + 12);
          /* left side of the cube */
            fill(255, 170, 200);
            quad(px, py, px + 25, py + 15, px + 25, py + 60, px, py + 45);
            fill(255, 200, 225);
            quad(px + 5, py + 8, px + 20, py + 18, px + 20, py + 52, px + 5, py + 43);
          /* right side of the cube */
            fill(255, 145, 180);
            quad(px + 25, py + 15, px + 50, py, px + 50, py + 45, px + 25, py + 60);
            fill(255, 160, 205);
            quad(px + 30, py + 18, px + 45, py + 8, px + 45, py + 43, px + 30, py + 52);
        }
    }
    noLoop();
}

I brought over the color theory from last week’s project and utilized it to make a series of repeating cubes. The inspiration of this popular pattern came from a bus ride back from a haircut I got at Bloomfield. I did a basic sketch on how the variables would be separated and implemented it in code to make a simple pattern that is stress-relieving to the eye.

sketch

Project – 05 – Wallpaper

sketch

function setup() {
    createCanvas(400, 600);
    background(0);

}
var squareSize = 80

var bSO = squareSize * (1/8)
var wLO = squareSize * (3/8)
var cr = squareSize * (2/10)
var obl = 5

function TSquare(x,y,w,h) {
    // Red Squares background of grid
    fill(148,3,3)
    stroke(0)
    strokeWeight(4)
    rect(x,y,w,h)

    // White line back 
    stroke(255)
    strokeWeight(5)
    line(x-obl, y-obl, x+w, y+h)

    // Blue square rounded corner transparent
    noStroke()
    fill(0, 0, 100, 200)
    //tint(255,127)
    rect(x+ bSO, y + bSO, w-(2 * bSO), h-(2 * bSO), cr, 0, cr, 0)

    // White line foreground   
    stroke(255)
    strokeWeight(5)
    line(x+30, y+30, x+w-30, y+h-30)

    //foreground black grid
    noFill()
    stroke(0)
    strokeWeight(4)
    //rect(x,y,w,h)

}

function draw() {
    for(xi=0; xi<width; xi = xi + squareSize){
        for(yj=0; yj<height; yj = yj + squareSize){
           
           TSquare(xi, yj, squareSize, squareSize)
        }
    } 

}

My inspiration for the start of this project was a plaid pattern. As I set out to attempt to recreate it, I made an error that ended up creating a very interesting novel pattern. I then riffed off of this new creation messing around with the alpha function which controls transparency. The pattern is a square of width and height 80 pixels iterated over x and y using for loops.

Kai Zhang-Project-05-Wallpaper

sketch

//Kai Zhang
//Section B
//kaiz1@andrew.cmu.edu
//Project-05

var i;

function setup() {
    createCanvas(480, 640);
}


function draw() {
	background(160, 200, 200);
	translate(-20, -20 - 10 * sqrt(2)); //shift it left and up so it's covering the whole canvas
	noStroke();

	for (i = 0; i < 20; i ++) {
		for (j = 0; j < 20; j ++) {

			//doing the odd number rows
			fill(240, 220, 100);
			beginShape();
			vertex(0 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(10 + 60 * i, 0 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(30 + 60 * i, 0 + (20 + 20 * sqrt(2)) * j);
			vertex(40 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + (20 + 20 * sqrt(2)) * j);
			endShape(CLOSE);
			//the first piece

			fill(50, 35, 200);
			beginShape();
			vertex(0 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(10 + 60 * i, 20 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(10 + 60 * i, 20 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(0 + 60 * i, 10 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			endShape(CLOSE);
			//the second piece

			fill(200, 35, 180);
			beginShape();
			vertex(40 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(30 + 60 * i, 20 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(30 + 60 * i, 20 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(40 + 60 * i, 10 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			endShape(CLOSE);
			//the third piece		



			push(); //doing the even number rows
			translate(30, 10 + 10 * sqrt(2));
			//shift the geometries where it should go, then just copy everything as they're completely the same
			
			fill(240, 220, 100);
			beginShape();
			vertex(0 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(10 + 60 * i, 0 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(30 + 60 * i, 0 + (20 + 20 * sqrt(2)) * j);
			vertex(40 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + (20 + 20 * sqrt(2)) * j);
			endShape(CLOSE);

			fill(50, 35, 200);
			beginShape();
			vertex(0 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(10 + 60 * i, 20 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(10 + 60 * i, 20 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(0 + 60 * i, 10 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			endShape(CLOSE);

			fill(200, 35, 180);
			beginShape();
			vertex(40 + 60 * i, 10 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + (20 + 20 * sqrt(2)) * j);
			vertex(20 + 60 * i, 30 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(30 + 60 * i, 20 + 20 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(30 + 60 * i, 20 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			vertex(40 + 60 * i, 10 + 10 * sqrt(2) + (20 + 20 * sqrt(2)) * j);
			endShape(CLOSE);			


			pop();
		}
	}


}

I’m interested in doing a 3D tessellation for the wallpaper. I got the inspiration from the Escher’s distorted architecture drawings and tessellation artworks. Then I’ve done a quick linework in Rhino to have precise placement of lines and lengths of them. So in the code I simple used the beginShape() function and connect all the points to create the geometry. The tricky part is that I’ve used 45 degrees for the diagonal lines, which I will need to calculate the exact location of vertex points using square roots. And in the end I just colored with high contrast colors for it to pop out and be more “3 dimensional”.

Image result for escher tessellations