Project-05 Wallpaper

For this project I did several sketches before I started to draft the design & code it. I was particularly inspired by the idea of the rising sun & linear sunbeams radiating from it.

I thought the contrast between the more organic circle and the rigorous linework created an interesting composition.

The final draft before I went into to digital process. A simple tiling method turns the design into a undulating diamond grid.

-Robert

sketch
//Robert Rice
//Section C
//rdrice@andrew.cmu.edu
//Assignment-05-A


size = 100   //the side length of each hexagon

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

function draw() {
    background(38, 0, 77);

    for(let w = 0; w <= width/(size*0.75); w = w+1) {
        for(let v = 0; v <= height/(size); v = v+1) {
            tile(w*0.375*size, v*0.5*size, size);
            print(w, v);
        }
    }
    noLoop();
}

function tile(x, y, s) {
    push();
    
    translate(x, y);
    stroke(204, 170, 0);
    strokeWeight(1);

    line(x + 0.375*s, y + 0.5*s, x, y);
    line(x + 0.375*s, y + 0.5*s, x + 0.188*s, y);
    line(x + 0.375*s, y + 0.5*s, x + 0.563*s, y);
    line(x + 0.375*s, y + 0.5*s, x + 0.750*s, y);

    line(x + 0.375*s, y + 0.5*s, x, y + s);
    line(x + 0.375*s, y + 0.5*s, x + 0.188*s, y + s);
    line(x + 0.375*s, y + 0.5*s, x + 0.563*s, y + s);
    line(x + 0.375*s, y + 0.5*s, x + 0.750*s, y + s);

    strokeWeight(1);
    stroke(255);
    line(x, y + 0.575*s, x + 0.75*s, y + 0.575*s);

    noStroke();
    fill(255, 77, 77);
    circle(x + 0.375*s, y + 0.5*s, 0.4*s);

    strokeWeight(1);
    stroke(255);
    line(x, y + 0.625*s, x + 0.75*s, y + 0.625*s);
    
    pop();
}

Project 5: Wallpaper

wallpaper cb
function setup() {
    createCanvas(600, 600);
    noLoop();
}

function draw() {
    background(249, 220, 180);

    //grid pattern background
    for (var x = 0; x <= width; x += 20) {
        for (var y = 0; y <= height; y += 20) {
        push();
        translate(x, y);
        grid();
        pop();
        }
    }

    //columns of 4 eggs
    for (var x = 56; x <= 560; x += 164) {
        for (var y = 72; y <= 522; y += 150) {
        push();
        translate(x, y);
        rotate(radians(-20));
        egg();
        pop();
        }
    }

    //columns of 3 eggs
    for (var x = 140; x <= 470; x += 164) {
        for (var y = 150; y <= 450; y += 150) {
        push();
        translate(x, y);
        rotate(radians(30));
        scale(.85);
        egg();
        pop();
        }
    }

    //columns of 3 bacons
    for (var x = 50; x <= 546; x += 164) {
        for (var y = 144; y <= 450; y += 150) {
        push();
        translate(x, y);
        rotate(radians(20));
        scale(.5);
        bacon();
        pop();
        }
    }

    //columns of 4 bacons
    for (var x = 140; x <= 472; x += 162) {
        for (var y = 70; y <= 538; y += 152) {
        push();
        translate(x, y);
        rotate(radians(-280));
        scale(.7);
        bacon();
        pop();
        }
    }
}

function egg() {
    fill(255);  //white
    noStroke();
    ellipse(-11, -14, 40, 42);
    ellipse(-7, 21, 50, 48);
    beginShape();
    curveVertex(4, -28);
    curveVertex(4, -28);
    curveVertex(23, 10);
    curveVertex(9, 40);
    curveVertex(9, 40);
    endShape();
    beginShape();
    curveVertex(-27, -10);
    curveVertex(-27, -10);
    curveVertex(-10, -10);
    curveVertex(-27, 10);
    curveVertex(-27, 10);
    endShape();

    fill(255, 200, 100);  //yolk
    ellipse(-2, 5, 30);
    noFill();
    stroke(255);
    strokeWeight(3);
    arc(-2, 5, 20, 20, HALF_PI, PI);
}

function bacon() {
    noFill();
    strokeWeight(8);
    strokeCap(SQUARE);
    stroke(147, 73, 0);
    bezier(35, -25, -40, -40, 40, 40, -35, 35);
    push();
    translate(13, 13);
    bezier(35, -25, -40, -40, 40, 40, -35, 35);
    pop();
}

function grid() {
    rectMode(CENTER);
    noStroke();
    fill(255, 175, 148, 150);
    rect(0, 0, 17, 17);
}

For this project, I was inspired by my water bottle, which has an eggs and bacon design on it. I decided to make my own pattern and have included some of my initial sketches below. I wanted to play with custom shapes, specifically curveVertex and bezier curves, as well as arcs. To add visual interest, I experimented with shifts in scale and rotation in creating an alternating pattern of eggs and bacon.

water bottle
quick procreate sketch
illustrator sketches

LO5: Computer Graphics

Apples by Aleksandr Kuskov

Apples by Aleksandr Kuskov is a 3D render that exaggerates the reality of cutting fruits. In his work, Kuskov uses Autodesk Maya and Keyshot to achieve these hyper-realistic effects. I really enjoy this work because as I look at it– the sliced apples flying elegantly left and right, the fresh berries, smooth-textured peaches, and the splashing of apple juice–makes me thirsty. I couldn’t resist but think about how fulfilling it would be to have a taste of that sweet and refreshing juice. Through his 3D render work, Kuskov turns typical household fruits and the mundane process of cutting them up into something elegant and dynamic while provoking a sense of desire as it responds to the basic human need of eating. 

Link: https://alekscg.pro/fruit

Title: Apples

Creater: Aleksandr Kuskov

Year: 2020

Project 05: Wallpaper

This wallpaper was inspired by a phone case I recently purchased online. Watermelons are one of my favorite fruits and green is my favorite color so I thought it’d be fun to code this design. To make it more dynamic, I decided to make the positions of the watermelons somewhat random and the placement of the seeds random inside so that each slice is unique.

sketch
function setup() {
    createCanvas(600, 400);
    background(101, 173, 119); // green background
    for(var x = 0; x <= width; x += 20){ // vertical stripes
    	stroke(136, 213, 156);
    	strokeWeight(5);
    	line(x, 0, x, height);
    }
    for(var y = 0; y <= height; y += 20){ // horizontal stripes
    	stroke(136, 213, 156);
    	strokeWeight(5);
    	line(0, y, width, y);
    }

}

function watermelonHalf() { // draw watermelon halves
	//semicircle
	rotate(radians(random(-30, 30))); // random position
	noStroke();
	fill(38, 144, 65);
	arc(0, 0, 60, 60, 0, PI); // green part
	fill(255);
	arc(0, 0, 55, 55, 0, PI); // white part
	fill(236, 80, 102);
	arc(0, 0, 50, 50, 0, PI); // red part
	for(var seeds = 0; seeds <= 5; seeds += 1){ // random seed positions
		fill(0);
		ellipse(random(-20, 20), random(5, 15), 2, 3);
	}
	noLoop();
}

function watermelonSlice() { // draw watermelon slices
	//triangular slice
	rotate(radians(random(60, 90))); // random position
	noStroke();
	fill(38, 144, 65);
	arc(0, 0, 70, 70, 0, PI/3); // green
	fill(255);
	arc(0, 0, 65, 65, 0, PI/3); // white
	fill(236, 80, 102);
	arc(0, 0, 60, 60, 0, PI/3); // red 
	for(var seeds = 0; seeds <= 2; seeds += 1){ // seeds
		fill(0);
		ellipse(random(15, 20), random(5, 20), 2, 3);
	}
	noLoop();
}

var column = 0; // column counter to alternate 
function draw() {
	for(var x = 30; x <= width; x += 80){
		if(column%2 == 0){ // if odd number columns
			for(var y = 0; y <= height; y += 120){ // first slice
				push();
				translate(x, y);
				watermelonSlice();
				pop();
			}
			for(var y = 60; y <= height; y += 120){ // second half
				push();
				translate(x, y);
				watermelonHalf();
				pop();
			}
			column += 1; // add to column counter
		}
		else{ // if even number columns
			for(var y = 0; y <= height; y += 120){ // first half
				push();
				translate(x, y);
				watermelonHalf();
				pop();
			}
			for(var y = 60; y <= height; y += 120){ // second slice
				push();
				translate(x, y);
				watermelonSlice();
				pop();
			}
			column += 1; // add to counter
		}
	}
}



Project 04-String Art

sketch
var dx2;
var dy2;
var dy3;
var numLines = 30;

function setup() {
    createCanvas(400, 300);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
    noStroke();
    line(200, 50, 200, 250);    //vertical guide line
    line(100, 50, 300, 250);    //diagonal guide line
    dx2 = (200)/numLines;
    dy2 = (200)/numLines;
    dy3 = (300)/numLines;
}

function draw() {
    background(0);

    // outer ring
    push();
    translate(200, 150); //origin in the middle
    for (let i = 1; i <= 200; i += 1) {
        rotate(2);      //rotating around the origin
        stroke(184, 156, 46, 70)
        line(-50, -130, 200, -150);
    }

    pop();
    //  the middle square
    var x1 = 100;
    var y1 = 250;
    var x2 = 100;
    var y2 = 50;
    for (let i = 0; i <= numLines; i += 1) {
        stroke(111, 162, 179, 150);
        line(x1, y1, x2, y2);
        line(x1+200, y1-200, x2, y2);
        x2 += dx2;
        y2 += dy2;
    }

    var x1 = 100;
    var y1 = 150;
    var x2 = 200;
    var y2 = 50;
    for (let i = 0; i <= numLines; i += 1) {
        //biggest diamond
        stroke(40, 77, 89);
        line(x1-100, y1, x2, y2-100);
        line(x1-100, y1, x2, y2+100);
        line(x1+300, y1, x2, y2-100);
        line(x1+300, y1, x2, y2+100);

        //smallest diamond
        stroke(111, 162, 179);
        line(x1, y1, x2, y2);
        line(x1+200, y1, x2, y2)
        y2 += dy2;
    }
    noLoop();
}

This is my string art inspired by a diamond ring. I wanted the diamonds to look three-dimensional.

Project 04: String Art

For this project I chose to draw a series of four triangles around a circle that somewhat resembles light emanating from a bright white circle into the dark background.

sketch

//Helen Cheng
//helenc1
//Section C

var numLines = 50;
var canvasX = 400;
var canvasY = 300;

function setup() {
    createCanvas(400, 300);
    background(0);
    strokeWeight(0.5);
}

function draw() {
    fill(232, 231, 227);
    circle(200, 150, 200);
    line(canvasX/2, 0, 0, canvasY);
    line(canvasX/2, 0, canvasX, canvasY);
    //initilizing spacing for lines drawn
    var dist = canvasX/(numLines);
    for (var i = 0; i <= numLines; i += 1) {
      //upright triangle
      stroke(163, 66, 199)
      line(canvasX/2, 0, dist*i, canvasY);
      //upside down triangle
      stroke(232, 221, 60);
      line(canvasX/2, canvasY, dist*i, 0);
      //left triangle
      stroke(47, 255, 0);
      line(300, 150, 0, dist*i);
      //right triangle
      stroke(255, 0, 0);
      line(100, 150, canvasX, dist*i);  
    }
    noLoop();
}

Project 04 – String Art

I tried to visualize an image of eye through various shapes of string art.

sketch
//Stefanie Suk
//15-104 Section D

var ax1;
var ay1;
var ax2;
var ay2;      //variable for top left white strings 

var bx1;
var by1;
var bx2;
var by2;      //variable for top right white strings 

var cx1;
var cy1;
var cx2;
var cy2;      //variable for bottom right white strings 

var dx1;
var dy1;
var dx2;
var dy2;      //variable for bottom left white strings 

var fx1;
var fy1;
var fx2;
var fy2;      //variable for top bottom orange strings 

var gx1;
var gy1;
var gx2;
var gy2;      //variable for left right orange strings 

var numLines = 40;
var numLines2 = 50;

function setup() {
    createCanvas(400, 300);
    background(25, 44, 108);

    //base lines for top left white strings
    line(0, 300, 0, 0);
    line(0, 0, 400, 0);
    ax1 = (0-0)/numLines;
    ay1 = (0-300)/numLines;
    ax2 = (400-0)/numLines;
    ay2 = (0-0)/numLines;

    //base lines for top right white strings
    line(0, 0, 400, 0);
    line(400, 0, 400, 300);
    bx1 = (400-0)/numLines;
    by1 = (0-0)/numLines;
    bx2 = (400-400)/numLines;
    by2 = (300-0)/numLines;

    //base lines for bottom right white strings
    line(400, 0, 400, 300);
    line(400, 300, 0, 300);
    cx1 = (400-400)/numLines;
    cy1 = (300-0)/numLines;
    cx2 = (0-400)/numLines;
    cy2 = (300-300)/numLines;

    //base lines for bottom left white strings
    line(400, 300, 0, 300);
    line(0, 300, 0, 0);
    dx1 = (0-400)/numLines;
    dy1 = (300-300)/numLines;
    dx2 = (0-0)/numLines;
    dy2 = (0-300)/numLines;

    //base lines for top bottom orange strings
    line(200, 0, 400, 0);
    line(200, 300, 0, 300);
    fx1 = (400-200)/numLines2;
    fy1 = (0-0)/numLines2;
    fx2 = (0-200)/numLines2;
    fy2 = (300-300)/numLines2;

    //base lines for left right orange strings
    line (0, 0, 0, 150);
    line(400, 300, 400, 150);
    gx1 = (0-0)/numLines2;
    gy1 = (150-0)/numLines2;
    gx2 = (400-400)/numLines2;
    gy2 = (150-300)/numLines2;
}

function draw() {

	//center pink strings
	for (var i = 0; i < 300; i += 8) {
		stroke(255, 161, 231); //pink
		strokeWeight(1);
		line (width/2, i + 0, i + width/2, height/2); //top right
		line(width/2, height - i, i + width/2, height/2); //bottom right
        line(width/2, i + 0, width/2 - i, height/2); //top left
        line(width/2, height - i, width/2 - i, height/2); //bottom left
	}

	//top left white strings
	var x1a = 0;
	var y1a = 300;
	var x2a = 0;
	var y2a = 0;
	for (var i = 0; i <= numLines; i +=1) {
		stroke(255);
		strokeWeight(1);
		line(x1a, y1a, x2a, y2a);
		x1a += ax1;
		y1a += ay1;
		x2a += ax2;
		y2a += ay2;
	}

	//top right white strings
	var x1b = 0;
	var y1b = 0;
	var x2b = 400;
	var y2b = 0;
	for (var i = 0; i <= numLines; i +=1) {
		line(x1b, y1b, x2b, y2b);
		x1b += bx1;
		y1b += by1;
		x2b += bx2;
		y2b += by2;
	}

	//bottom right white strings
	var x1c = 400;
	var y1c = 0;
	var x2c = 400;
	var y2c = 300;
	for (var i = 0; i <= numLines; i +=1) {
		line(x1c, y1c, x2c, y2c);
		x1c += cx1;
		y1c += cy1;
		x2c += cx2;
		y2c += cy2;
	}

	//bottom left white strings
	var x1d = 400;
	var y1d = 300;
	var x2d = 0;
	var y2d = 300;
	for (var i = 0; i <= numLines; i +=1) {
		line(x1d, y1d, x2d, y2d);
		x1d += dx1;
		y1d += dy1;
		x2d += dx2;
		y2d += dy2;
	}

	//center circle yellow strings
	for (var e = 120; e <= 240; e++) {
		stroke(247, 241, 117);
		strokeWeight(1.5);
		noFill();
		ellipse(width/2, height/2, e, e);
		e += 4; //spacing
	}

	//top bottom orange strings
	var x1f = 200;
	var y1f = 0;
	var x2f = 200;
	var y2f = 300;
	for (var i = 0; i <= numLines2; i +=1) {
		stroke(255, 134, 4, 70);
		line(x1f, y1f, x2f, y2f);
		x1f += fx1;
		y1f += fy1;
		x2f += fx2;
		y2f += fy2;
	}

	//left right orange strings
	var x1g = 0;
	var y1g = 0;
	var x2g = 400;
	var y2g = 300;
	for (var i = 0; i <= numLines2; i +=1) {
		line(x1g, y1g, x2g, y2g);
		x1g += gx1;
		y1g += gy1;
		x2g += gx2;
		y2g += gy2;
	}

	noLoop();
}

Project-04-String Art

sketch
var dx1;
var dy1;
var dx2;
var dy2;
var numLines = 50;

function setup() {
    createCanvas(400, 300);

    // x1, x2, endx1, endx2
    line(50, 50, 150, 300);
  
    // y1, y2, endy1, endy2
    line(300, 300, 350, 100);
  
    //endx1 - x1/numlines
    dx1 = (150-50)/numLines;
  
    //endx2 - x2/numlines
    dy1 = (300-50)/numLines;
  
    //endy1 - y1/numlines
    dx2 = (350-300)/numLines;
  
    //endy2 - y2/numlines
    dy2 = (100-300)/numLines;
    
}

function draw() {
    background(255, mouseX, mouseY);
    var x1 = 50;
    var y1 = 50;
    var x2 = 300;
    var y2 = 300;
    for (var i = 0; i <= numLines; i += 1) {
        line(x1, y1, x2, y2);
        x1 += dx1;
        y1 += dy1;
        x2 += dx2;
        y2 += dy2;
    }
    //noLoop();
  
  stroke(255,0,0);
  var x11 = 50;
    var y11 = 50;
    var x22 = 300;
    var y22 = 300;
    for (var i = 0; i <= numLines; i += 1) {
        line(x1, y1, x2, y2);
        x1 += dx1;
        y1 += dy1;
        x2 += dx2;
        y2 += dy2;
    }
    //noLoop();
  
  stroke(0,255,0);
    var x113 = 50;
    var y113 = 50;
    var x223 = 300;
    var y223 = 300;
    for (var i = 0; i <= 50; i += 1) {
        line(x223, y223, x113, y11);
        x113 += dx1;
        y113 += dy1;
        x223 += dx2;
        y223 += dy2;
    }
    //noLoop();

    for(var y = 0; y<=300; y+=15){
    	stroke(mouseX, mouseY,40);
    	line(y,0,400,y);
    	stroke(mouseY,mouseX,200);
    	line(0,y,y-5,300);

    }
  

}

Project 4: String Art

Keep your mouse pressed to see the magic! (not actually that cool but I tried.. lol..)

sketch
idea sketches

var x = 250;
var y = 25;
var x2 = 300;
var y2 = 250;

function setup() {
    createCanvas(300,300);
    background('blue');
}

function draw() {
  
  //setting up colors and background to help lines stand out
    background(255,5);
    stroke(255);
    if (mouseIsPressed){
     var R = random(200,255);
     var B = random(200,255);
     strokeWeight(random(0,3));
     stroke(R,0,B,random(50,100));
    }else{
     strokeWeight(random(0,10));
     stroke(255);
     background(0,random(0,50),random(0,50));

    }
    line(x,250,100,y);
    line(250,height - y,width - x,100);
    line(width - x,300,50,height - y);
    line(250,y,x,0);

    // top left and bottom right corner curves
    line(100,y2,x,50);
    line(300,height - y2,width - x,300);

    //string animation
    x += 5;
    y += 1;
    x2 -= 5;
    y2 -= 1;

    //trying to set parameters for the line movements
    x = constrain(x,100,300);
    y = constrain(y,0,300);
    x2 = constrain(x2,50,300);
    y2 = constrain(y2,25,250);

    //loop and reset 
    if (x == 300 & y == 300 && x2 == 50 && y2 == 25) {
        x = x2;
        y = y2;
        y2 = 250;
    }
}

Project 04 – String Art

In making this I was inspired by the motion artist / music producer Dedouze.

sketch
//First line art
var dx1;
var dy1;
var dx2;
var dy2;

//Second line art
var dx3;
var dy3;
var dx4;
var dy4;

//Third line art
var dx5;
var dy5;
var dx6;
var dy6;

//Fourth line art
var dx8;
var dy8;
var dx9;
var dy9;

var numLines = 50;
var numLines2 = 20;
var numLines3 = 60;
var numLines4 = 40;
function setup() {
    createCanvas(400, 300);
    background(100, 105, 200);

    //First line art placement
    line(0, 0, 0, 300);
    line(0, 300, 350, 300);

    //Second line art placement
    line(0, 300, 150 ,300);
    line(400, 300, 400, 240);

    //Third line art placement
    line(0, 300, 400, 300);
    line(400, 300, 400, -100);

    //Fourth line art placement
    line(-50, 0, 0, 400);
    line(450, 40, 400, -400);

    //First line art deltas
    dx1 = (0 - 0)/numLines;
    dy1 = (300 - 0)/numLines;
    dx2 = (350 - 0)/numLines;
    dy2 = (300 - 300)/numLines;

    //Second line art deltas
    dx3 = (150 - 0)/numLines2;
    dy3 = (300 - 300)/numLines2;
    dx4 = (400 - 400)/numLines2;
    dy4 = (240 - 300)/numLines2;

    //Third line art deltas
    dx5 = (400 - 0)/numLines3;
    dy5 = (300 - 300)/numLines3;
    dx6 = (400 - 400)/numLines3;
    dy6 = (-100 - 300)/numLines3;

    //Fourth line art deltas
    dx7 = (0 - -50)/numLines4;
    dy7 = (400 - 0)/numLines4;
    dx8 = (400 - 450)/numLines4;
    dy8 = (-400 - 40)/numLines4;

}

function draw() {
    var x1 = 0;
    var y1 = 0;
    var x2 = 0;
    var y2 = 300;

    var x3 = 0;
    var y3 = 300;
    var x4 = 400;
    var y4 = 300;

    var x5 = 0;
    var y5 = 300;
    var x6 = 400;
    var y6 = 300;

    var x7 = -50;
    var y7 = 0;
    var x8 = 450;
    var y8 = 400;


    stroke(245, 255, 184);
    for (var i = 0; i <= numLines4; i += 1) {
        line(x7, y7, x8, y8);
        x7 += dx7;
        y7 += dy7;
        x8 += dx8;
        y8 += dy8;
    }

    stroke(254, 189, 255);
    for (var i = 0; i <= numLines3; i += 1) {
        line(x5, y5, x6, y6);
        x5 += dx5;
        y5 += dy5;
        x6 += dx6;
        y6 += dy6;
    }
    stroke(191, 255, 251);
    for (var i = 0; i <= numLines; i += 1) {
        line(x1, y1, x2, y2);
        x1 += dx1;
        y1 += dy1;
        x2 += dx2;
        y2 += dy2;
    }

    for (var i = 0; i <= numLines2; i += 1) {
        line(x3, y3, x4, y4);
        x3 += dx3;
        y3 += dy3;
        x4 += dx4;
        y4 += dy4;
    }
    noLoop();
}