amui1-Project-03-Dynamic-Drawing

Click to change time of day

amui1-p3

//Allison Mui
//15-104 Section A
//amui1@andrew.cmu.edu
//Project-03

//variables for cloud
var cloud1x = 50;
var cloud1y = 100;
var cloud2x = 90;
var cloud2y = 90;
var cloud3x = 130;
var cloud3y = 100;
var speed = .30;
var dir = 1;
//variables for rain
var rainY = 110
var rainSpeed = 5;
//variables for bird
var birdHx = 300;
var birdHy = 250;
//variables for easing
var easing = .005;
//variables to switch b/w time of daytime
var day = 0;

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

function draw() {
  if (day == 0) {
    background(151,214,216);
    //sun
    fill(255,255,0);
    ellipse(600,0,225,225);
    //flower
    //flowerstem
    stroke(0,100,0);
    strokeWeight(8);
    var stemY = constrain(mouseY,350,480);
    line(100,stemY,100,480);
    //flowerbody
    stroke(0);
    strokeWeight(0);
    fill(0);
    //restrict flower height
    var flowerY = constrain(mouseY,350,480);
    var flowerSize = flowerY*20/175;
    fill(255,255,0);
    arc(100,flowerY,flowerSize*2-25,flowerSize*2+5,PI,0);
    arc(100,flowerY,flowerSize*2-25,flowerSize*2+5,0,PI);
    arc(100,flowerY,flowerSize*2+10,flowerSize*2-30,HALF_PI,3*HALF_PI);
    arc(100,flowerY,flowerSize*2+10,flowerSize*2-30,3*HALF_PI,HALF_PI);
    fill(0);
    ellipse(100,flowerY,flowerSize,flowerSize);


    //clouds
    fill(255);
    strokeWeight(0);
    //firstcloud
    ellipse(cloud1x,cloud1y,50,50);
    ellipse(cloud2x,cloud2y,70,80);
    ellipse(cloud3x,cloud3y,50,50);
    //secondcloud
    ellipse(cloud1x+200,cloud1y,50,50);
    ellipse(cloud2x+200,cloud2y,70,80);
    ellipse(cloud3x+200,cloud3y,50,50);
    //thirdcloud
    ellipse(cloud1x+400,cloud1y,50,50);
    ellipse(cloud2x+400,cloud2y,70,80);
    ellipse(cloud3x+400,cloud3y,50,50);
    //movecloud
    cloud1x += dir*speed;
    cloud2x += dir*speed;
    cloud3x += dir*speed;
    //loopclouds
    if (cloud3x > width-25 || cloud1x < 25){
      dir = -dir;
    }
    if (cloud3x + 200 > width-25 || cloud1x+200 < 25){
      dir = -dir;
    }
    if (cloud3x + 400 > width-25 || cloud1x+400 < 25){
      dir = -dir;
    }
  } else{
    background(25,25,112);
    fill(255);
    strokeWeight(0);
    //firstcloud
    ellipse(cloud1x,cloud1y,50,50);
    ellipse(cloud2x,cloud2y,70,80);
    ellipse(cloud3x,cloud3y,50,50);
    //secondcloud
    ellipse(cloud1x+200,cloud1y,50,50);
    ellipse(cloud2x+200,cloud2y,70,80);
    ellipse(cloud3x+200,cloud3y,50,50);
    //thirdcloud
    ellipse(cloud1x+400,cloud1y,50,50);
    ellipse(cloud2x+400,cloud2y,70,80);
    ellipse(cloud3x+400,cloud3y,50,50);
    //movecloud
    cloud1x += dir*speed;
    cloud2x += dir*speed;
    cloud3x += dir*speed;
    //loopclouds
    if (cloud3x > width-25 || cloud1x < 25){
      dir = -dir;
    }
    if (cloud3x + 200 > width-25 || cloud1x+200 < 25){
      dir = -dir;
    }
    if (cloud3x + 400 > width-25 || cloud1x+400 < 25){
      dir = -dir;
    }

    //rain
    fill(220,220,220);
    ellipse(cloud1x,rainY+10,10,10);
    ellipse(cloud2x,rainY+10,10,10);
    ellipse(cloud3x,rainY+10,10,10);
    ellipse(cloud1x+200,rainY+10,10,10);
    ellipse(cloud2x+200,rainY+10,10,10);
    ellipse(cloud3x+200,rainY+10,10,10);
    ellipse(cloud1x+400,rainY+10,10,10);
    ellipse(cloud2x+400,rainY+10,10,10);
    ellipse(cloud3x+400,rainY+10,10,10);
    rainY += rainSpeed;
    if (rainY > height/2 - 40){
      rainY = cloud1y + 10;
    }
  }

  //drawbird
  //bird flying right
  if (mouseX > birdHx) {
    var targetX = mouseX;
    var distX = mouseX - birdHx;
    birdHx += distX*easing;
    //where bird wants to travel y
    var targetY = mouseY;
    var distY = mouseY - birdHy;
    birdHy += distY*easing;

    //birdhair
    stroke(255,255,153);
    strokeWeight(5);
    line(birdHx-2,birdHy-25,birdHx+3,birdHy-10);
    line(birdHx+6,birdHy-25,birdHx-2,birdHy-10);
    //birdlegs
    strokeWeight(0);
    fill(255,140,0);
    rect(birdHx-30,birdHy+50,3,10);
    rect(birdHx-20,birdHy+50,3,10);
    ellipse(birdHx-27,birdHy+60,5,5);
    ellipse(birdHx-17,birdHy+60,5,5);
    //birdbody
    if (mouseY < 100){
      fill(255,250,250);
      strokeWeight(0);
      ellipse(birdHx,birdHy,40,40);
      ellipse(birdHx-20,birdHy+30,60,45);
      ellipse(birdHx-45,birdHy+20,25,20);
      //halo
      noFill();
      stroke(0,191,255);
      strokeWeight(3);
      ellipse(birdHx+3,birdHy-35,20,5);
    } else {
      fill(255,255,153);
      strokeWeight(0);
      ellipse(birdHx,birdHy,40,40);
      ellipse(birdHx-20,birdHy+30,60,45);
      ellipse(birdHx-45,birdHy+20,25,20);
    }
    //birdbeak
    strokeWeight(0);
    fill(255,140,0);
    triangle(birdHx+20,birdHy-2,birdHx+30,birdHy+10,birdHx+16,birdHy+10);
    //wing
    arc(birdHx-20,birdHy+28, 13, 25, 0, PI+QUARTER_PI, CHORD);
    //eye
    fill(255);
    ellipse(birdHx,birdHy,15,15);
    fill(0);
    ellipse(birdHx+3,birdHy,8,8);
  }
  if (mouseX < birdHx) {
    //bird flying left
    var targetX = mouseX;
    var distX = mouseX - birdHx;
    birdHx += distX*easing;
    //where bird wants to travel y
    var targetY = mouseY;
    var distY = mouseY - birdHy;
    birdHy += distY*easing;
    //birdhair
    stroke(255,255,153);
    strokeWeight(5);
    line(birdHx-7,birdHy-25,birdHx-2,birdHy-10);
    line(birdHx+3,birdHy-25,birdHx-2,birdHy-10);
    //birdlegs
    strokeWeight(0);
    fill(255,140,0);
    rect(birdHx,birdHy+50,3,10);
    rect(birdHx+10,birdHy+50,3,10);
    ellipse(birdHx,birdHy+60,5,5);
    ellipse(birdHx+10,birdHy+60,5,5);
    if (mouseY < 100){
      fill(255,250,250);
      strokeWeight(0);
      ellipse(birdHx,birdHy,40,40);
      ellipse(birdHx+10,birdHy+30,60,45);
      ellipse(birdHx+30,birdHy+20,25,20);
      //halo
      noFill();
      stroke(0,191,255);
      strokeWeight(3);
      ellipse(birdHx+3,birdHy-35,20,5);
    } else {
      fill(255,255,153);
      strokeWeight(0);
      ellipse(birdHx,birdHy,40,40);
      ellipse(birdHx+10,birdHy+30,60,45);
      ellipse(birdHx+30,birdHy+20,25,20);
    }
    strokeWeight(0);
    //birdbeak
    fill(255,140,0);
    triangle(birdHx-20,birdHy-2,birdHx-30,birdHy+10,birdHx-16,birdHy+10);
    //wing
    arc(birdHx+10,birdHy+28, 13, 25, 0, PI+QUARTER_PI, CHORD);
    //eye
    fill(255);
    ellipse(birdHx,birdHy,15,15);
    fill(0);
    ellipse(birdHx-2,birdHy,8,8);
}
}
function mousePressed() {
    if (day == 0) {
      day = 1;
    } else {
      day = 0;
    }
}

For this project, I made a little story about a bird/duck that can fly. I had a lot of fun with this project, trying out new ways to incorporate mouseX and mouseY. I first sketched out the background and then started to hardcode in p5js. After that, I changed my objects to be coordinated with mouseX and mouse Y. The most difficult part was coordinating the size of the flower with mouseY. The things I controlled with my mouse was: size of the flower, position of the flower, color of the duck, and direction of the duck.

 

BrandonHyun-Project-03-Dynamic-Drawing

sketch

//Brandon Hyun
//15104 Section B
//bhyun1@andrew.cmu.edu
//Project-03

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

function draw() {
//darkens the background as mouse gets closer (0,0) and lighten when the mouse gets closer to (640,0)
  background(mouseX,mouseY);
  fill(0);
  noStroke();

//left upper corner chaos circle
  //setting cordinates of where the circles are going to be drawn.
  randomXlocation = random (width/2 +1);
  randomYlocation = random (height/2 +1);
  //drawing the circles with the cordinates and the size of the circle.
  ellipse (randomXlocation, randomYlocation, 50,50);


//right lower corner chaos circle
  //setting cordinates of where the circles are going to be drawn.
  randomXlocation = width/2+ random (width/2 +1);
  randomYlocation = height/2+ random (height/2 +1);
  //drawing the circles with the cordinates and the size of the circle.
  ellipse (randomXlocation, randomYlocation, 50,50);

}

For this project, I wanted to create something that had a simple concept but complicated visuals. While I was working, I wanted to express the emotion of hecticness that could only be hidden by shadows.

When I was working on this, I had a hard time in the beginning because I wasn’t really sure what variables I needed this code to work.

I think I figured it out.

 

abradbur-Project-03-Dynamic Drawing

Dynamic Drawing

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

function draw() {
    background(33, 32, 29);

    //clouds follow or pass by the mouse
    var cloudcover = -mouseX + 640;
    var cloudsize =  mouseY * 0.25;
    fill(140, 138, 146);
    noStroke();
    ellipse(mouseX, 100, cloudsize, cloudsize);
    ellipse(mouseX + 20, 150, cloudsize, cloudsize);
    ellipse(mouseX + 5, 200, cloudsize, cloudsize);
    ellipse(mouseX - 50, 207, cloudsize, cloudsize);
    ellipse(mouseX + 100, 200, cloudsize, cloudsize);
    ellipse(mouseX -15, 200, cloudsize, cloudsize);
    ellipse(cloudcover, 350, cloudsize, cloudsize);
    ellipse(cloudcover + 50, 340, cloudsize, cloudsize);
    ellipse(cloudcover - 8, 330, cloudsize, cloudsize);
    ellipse(cloudcover + 10, 315, cloudsize, cloudsize);
    ellipse(cloudcover - 10, 290, cloudsize, cloudsize);
    ellipse(cloudcover - 45, 350, cloudsize, cloudsize);
    
    //stage
    fill(0);
    rect(0, 420, 640, 60);
    rect(40, 360, 560, 60);

    //lights
    fill(255);
    quad(45, 480, 55, 420, 105, 450, 85, 480);
    quad(555, 480, 525, 450, 575, 420, 595, 480);
    quad(45, 0, 55, 60, 105, 30, 85, 0);
    quad(555, 0, 525, 30, 575, 60, 595, 0);

    //Edward
    fill(0);
    //head
    triangle( 80, 200, 95, 230, 110, 200);
    triangle( 80, 200, 75, 190, 85, 200);
    triangle( 105, 200, 110, 190, 110, 200);
    triangle( 75, 190, 70, 215, 100, 200);
    //shoulders
    triangle( 65, 230, 95, 275, 125, 230);
    //waist
    quad( 85, 260, 90, 280, 100, 280, 105, 260);
    //flair
    quad( 90, 280, 75, 310, 95, 330, 105, 260);
    //legs
    triangle(100, 255, 103, 360, 105, 260);
    triangle(85, 290, 88, 360, 90, 280);
    //arms
    triangle(75, 240, 70, 280, 77, 240);
    triangle(70, 280, 90, 300, 70, 280);
    triangle(120, 230, 135, 200, 125, 230);
    triangle(135, 200, 150, 190, 136, 200);

    // depending on the position of the mouse
    //different lights will turn on
    if ((mouseX < 320) & (mouseY > 240)){
        fill(252, 18, 58, 51);
        quad( 55, 420, 320, 0, 105, 0, 105, 450);
    } if((mouseX > 320) & (mouseY > 240)){
        fill(254,205,68,51);
        quad( 525, 450, 70, 0, 575, 0, 575, 420);
    } if((mouseX <320) & (mouseY < 240)){
        fill(252, 51, 170, 51);
        quad (55, 60, 250, 480, 270, 480, 105, 30);
    } else{
        fill( 52, 253, 47, 51);
        quad (525, 30, 200, 480, 260, 480, 575, 60);
    }

    // if mouse in canvas, reveal text
    textSize(40);
    var W = "Welcome to Wonderland!"
    if((mouseX < 640) & (mouseX > 0) & (mouseY > 0) & (mouseY < 480)){
        fill(162, 16, 110);
        } else {
            fill(33, 32, 29);
        }
    text(W, 100, 35, 500, 200);
    
    //Wheel of Misfortune
    //move origin to the center
    translate(320, 240);
    rotate(radians(2 * frameCount));
    //first wheel slice
    fill(162, 16, 110);
    arc(0, 0, 300, 300, PI + 3 * QUARTER_PI, TWO_PI);
    //second
    fill(243, 226, 53);
    arc(0, 0, 300, 300, PI + 2 * QUARTER_PI, 7 * PI/4);
    //third 
    fill(253, 99, 169);
    arc(0, 0, 300, 300, PI + QUARTER_PI, 3 * PI/2);
    //fourth
    fill(37, 213, 161);
    arc(0, 0, 300, 300, PI, 5 * PI/4);
    //fifth
    fill(37, 213, 161);
    arc(0, 0, 300, 300, 0, PI/4);
    //sixth
    fill(162, 16, 110);
    arc(0, 0, 300, 300, PI/4, PI/2);
    //seventh
    fill(243, 226, 53);
    arc(0, 0, 300, 300, PI/2, 3 * PI/4);
    //eighth 
    fill(253, 99, 169);
    arc(0, 0, 300, 300, 3 * PI/4, PI);

}

I was really inspired by the description of a dungeon in one of my favorite podcasts, “The Adventure Zone”, and I thought this would be a really fun project to try to realize that scene in simple shapes. I did my best to use a whimsical color scheme and incorporate a lot of motion. I think that out of what we’ve done so far this is the project I’m most proud of, and the one I’ve spent the most time on.

cduong-LookingOutward-03

The picture above is from the weurbanist website linked below and shows one of the many 3D-printed connectors that were made for this project.

The project is about 3D-Printable Connectors that help make DIY furniture assembly easier. They use 3D printers to create an array of possible connectors that could be used to make all types of furniture. The goal of this project is to allow people to easily make their own furniture into something that fits their needs. I admire how the project is aimed to benefit anyone; it is not just for one specific group of people. I find this really interesting because I worked in woodshop a lot during my last school year and I also love working with 3D printers. I also love the idea of DIYs and do a few of them whenever I find something interesting on pinterest.

I suppose the algorithms they use varies depending on the type of furniture that they are aiming to make, whether it’s a table or a chair or something else. These algorithms have to create different angles and forms to accomplish a connection that could be used to create a table or a chair, since both pieces of furniture are used in very different ways. There is an infinite amount of algorithms that these creators could use and I’m sure they produce all types of connectors, hundreds of unique connectors.

The creator’s artistic sensibilities manifest into the final form by creating a specific type of connector that may force a piece of furniture to look or work a certain way, possibly a way that the creator prefers.

3D-Printable Connectors Make DIY Furniture Assembly Easy

This was created by Studio Minale-Maede (http://www.minale-maeda.com/) in 2012. It was known as the Keystone project.

Another photo from weurbanist that shows another type of connector that was created.

dayoungl – LookingOutwards 03

 

Iris Van Herpen SS11 <Crystallization> runway
Iris Van Herpen SS11 – Water Dress

Iris Van Herpen is a fashion designer who experiments with wide variety of subjects materials to fabricate her garments. Transforming industrial materials such as epoxy to high-end fashion, Harpen plays between the realm of fashion and technology. I first saw Iris Van Herpen’s work exhibited at Carnegie Museum of Art. When I entered the exhibition hall, I saw dresses that were unconventional and stunning- dresses that I have never seen elsewhere. Her dresses were not made from fabrics like other designers. Among her many dresses, I was especially drawn to her water dresses. Her water dresses were part of her couture series “Crystallization”, which inspired by the collaboration work between Herpen and Benthem Crouwel Architect. 

Benthem Crouwel’s design for a new extension to Amsterdam’s Stedelijk Museum had earned the nickname ‘bath tub’. This inspired Van Herpen to design a dress that would fall around the wearer like a splash of water, like being immersed in a warm bath, and to express in the collection the different states, structures and patterns of water. Noteworthy is that in this collection Van Herpen presents her first 3D-print that she created in collaboration with the London-based architect Daniel Widrig and that was printed by .MGX by Materialise.

Water dresses have very organic shape to them. However, they were intricately planned out for 3d prototyping. From the notes I took from the visit to the CMOA, she faced multiple difficulties and finding an adequate material that could be used for fabrication of this dress was one of them. I believe the material used for the water dresses was acrylic. I was able to find Herpen’s interview on this. When asked about the the procedures of making her water dresses, she commented “It’s a type of acrylic made especially for me that stays transparent after you heat it up. You heat it with hot-air guns and then transform the shapes with metal pliers. It has its own mind and you can never have full control over it. But I really like that. You almost have a relationship with it. I’m doing a project in March with SHOWstudio where I will show how it’s made.” (http://www.dazeddigital.com/fashion/article/15493/1/qa-iris-van-herpen). She also states that she was first drawn to 3d printing technology because she liked the visualization process from her design for the human body, which is 3d, to 3d prototypes rather than having to transfer her design to 2d sketches, and then to 3d form.

 

Hannah Kim-Looking Outwards-03

Minima | Maxima is computer science connoisseur Marc Fornes’s latest project, commissioned by World Expo 2017 in Astana, Kazakhstan. Fornes has placed himself at the forefront of computational design in the last 15 years, as well as the digital prototyping of large scale, self supporting structures. His studio is deeply rooted in the development of computational protocols and digital fabrication. This particular project involves a building system in which custom designed parts form complex, self-supporting curving surfaces. The project has an impressive height of 43 feet, yet the core material used to build the structure are simply 2mm strips of aluminum. The strips are constructed in only 3 layers in tandem, and support one another as they gain curvature and height. This project is extremely impressive to me because of the fact someone can make a huge, voluminous form that people can walk on, out of 2 mm triple layered aluminum sheets. I think the concept that one layer can’t exist independently, yet contributes and supports the structure as a whole is pretty great. Watching the video of the structure being built, it was shocking seeing the structure blowing in the wind while being built up, and then seeing the final, sturdy complete structure. I realized Fornes’s sensibilities as an artist are present in all of his computationally fabricated works, after seeing his website. His works are geometric and organic, and seemingly impossible.

images and close up of the sculpture

The Stripes Effect from MARC FORNES / THEVERYMANY on Vimeo.

link:http://www.thisiscolossal.com/2017/09/a-towering-4-story-organic-structure-built-from-material-as-thin-as-a-coin-by/

cduong-Project-03-Dynamic-Drawing

project03

/*
Name: Colleen Duong
Lab Section: D
Email: cduong@andrew.cmu.edu
Project-03 Dynamic Drawing
*/

var sunsize = 50;
var BR = 6; //Sky R color
var BG = 6; //Sky G color
var BB = 50; //Sky B color
var BRG = 25; //Ground R color
var BGG = 62; //Ground G color
var BBG = 16; //Ground B color
var SR = 255 //Sun R color
var SG = 255 //Sun G color
var SB = 255 //Sun B color
var sproutstemh = 610; //sprout stem height


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

function draw() {
  background(BR, BG, BB);
  noStroke();

//Sky   Start
  //Setting the boundaries for the morning colors to appear
  if ((mouseX >= 640) & (mouseX <= 640)){
      mouseX = 640;
  }

  //Setting the boundaries for the night colors to appear
  //background nighttime colors (6, 6, 50)
  //background daytime colors (187, 235, 235)
  if ((mouseX > 0) & (mouseX < 400)){
    BR = mouseX*((187-6)/400) + 6;
  	BG = mouseX*((235-6)/400) + 6;
  	BB = mouseX*((235-50)/400) + 50;
    }
//Sky   End


//The Sun   Start
  fill(SR, SG, SB);

  //Setting a constraint so the sun cannot leave the canvas
  var constrainy = constrain(mouseY, 0, 300);
  var constrainx = constrain(mouseX, 0, 600);

  //Creating the sun shape
  ellipse(constrainx, constrainy, sunsize, sunsize); //The circle

  //Setting the boundaries for sun to change to morning color
  if ((mouseX > 640) & (mouseX < 640)){
      mouseX = 640;
  }

  //Setting the boundaries for sun to change to night color
  //Daytime Grass (255, 199, 5)
  //Nighttime Grass (255, 255, 255)
  if ((mouseX > 0) & (mouseX < 640)){
    SR = mouseX*((255-255)/640) + 255;
    SG = mouseX*((199-255)/640) + 255;
    SB = mouseX*((5-255)/640) + 255;
    }

  //Changing the Sun Size depending on Location
  sunsize = (0.5*(mouseX+mouseY)); 
//The Sun   End


//Grass   Start
  //Ground
  fill(BRG, BGG, BBG);
  rect(0, 400, 680, 100);

  //Setting the boundaries for the morning grass colors to appear
  if ((mouseX > 640) & (mouseX < 640)){
      mouseX = 640;
  }

  //Setting the boundaries for the night grass colors to appear
  //Daytime Grass (78, 174, 55)
  //Nighttime Grass (25, 62, 16)
  if ((mouseX > 0) & (mouseX < 640)){
    BRG = mouseX*((78-25)/640) + 25;
    BGG = mouseX*((174-62)/640) + 62;
    BBG = mouseX*((55-16)/640) + 16;
    }
//Grass   End

//Stems Start
  //Make stems grow as the arrow moves across the x-axis
  push();
  translate(35, -mouseX+200); //Make the stems grow upward
  sproutS = rect(35, sproutstemh, 10, 300, 10);
  sprout2S = rect(105, sproutstemh, 10, 300, 10);
  sprout3S = rect(175, sproutstemh, 10, 300, 10);
  sprout4S = rect(245, sproutstemh, 10, 300, 10);
  sprout5S = rect(315, sproutstemh, 10, 300, 10);
  sprout6S = rect(385, sproutstemh, 10, 300, 10);
  sprout7S = rect(455, sproutstemh, 10, 300, 10);
  sprout8S = rect(525, sproutstemh, 10, 300, 10);
  pop();

  //Leaves that pop out of the stem depending on where your mouse is on the x axis
  //Key: SproutL is the first stem's sprouts, Sprout 2L is the second stem's sprouts, etc
  //Key2: SproutL2 is the second leaf from the ground, etc.
  if ((mouseX > 450)){ //First to pop up
    sproutL = ellipse(60, 380, 25, 20);
    sprout3L = ellipse(200, 370, 25, 20);
    sprout7L = ellipse(480, 360, 25, 20);
  }
  if ((mouseX > 480)){ //Second to pop up
    sprout2L = ellipse(130, 385, 25, 20);
    sprout4L = ellipse(300, 360, 25, 20);
    sprout6L = ellipse(410, 370, 25, 20);
    sproutL2 = ellipse(90, 320, 25, 20);
    sprout3L2 = ellipse(230, 320, 25, 20);
    sprout7L2 = ellipse(510, 330, 25, 20);
  }
  if ((mouseX > 520)){ //Third to pop up
    sprout5L = ellipse(340, 355, 25, 20);
    sprout8L = ellipse(580, 350, 25, 20);
    sprout2L2 = ellipse(160, 325, 25, 20);
    sprout3L3 = ellipse(200, 300, 25, 20);
    sprout4L2 = ellipse(270, 310, 25, 20);
    sprout6L2 = ellipse(440, 320, 25, 20);
    sprout7L3 = ellipse(480, 290, 25, 20);
  }
  if ((mouseX > 540)){ //Fourth to pop up
    sproutL3 = ellipse(60, 260, 25, 20);
    sprout2L3 = ellipse(130, 280, 25, 20);
    sprout3L4 = ellipse(230, 275, 25, 20);
    sprout4L3 = ellipse(300, 255, 25, 20);
    sprout5L2 = ellipse(370, 260, 25, 20);
    sprout6L3 = ellipse(410, 260, 25, 20);
    sprout7L4 = ellipse(510, 250, 25, 20);
    sprout8L2 = ellipse(550, 260, 25, 20);
  }

//Last to pop up: Flowers   Start
  if ((mouseX > 575)){ //Petal 1
    fill(247, 154, 185); //Pink Color
    ellipse(50, 200, 40, 40); //Pink

    fill(255, 180, 0); //Orange Color
    ellipse(190, 200, 40, 40); //Orange

    fill(191, 63, 63); //Red Color
    ellipse(120, 200, 40, 40); //Red

    fill(31, 144, 0); //Green Color
    ellipse(330, 200, 40, 40); //Green

    fill(255, 234, 0); //Yellow Color
    ellipse(260, 200, 40, 40); //Yellow

    fill(136, 73, 189); //Purple Color
    ellipse(470, 200, 40, 40); //Purple

    fill(17, 46, 173); //Blue Color
    ellipse(400, 200, 40, 40); //Blue

    fill(70, 63, 69); //Black Color
    ellipse(540, 200, 40, 40); //Black
}

  if ((mouseX > 565)){ //Petal 2
    fill(247, 154, 185); //Pink Color
    ellipse(100, 200, 40, 40); //Pink

    fill(255, 180, 0); //Orange Color
    ellipse(240, 200, 40, 40); //Orange

    fill(191, 63, 63); //Red Color
    ellipse(170, 200, 40, 40); //Red

    fill(31, 144, 0); //Green Color
    ellipse(380, 200, 40, 40); //Green

    fill(255, 234, 0); //Yellow Color
    ellipse(310, 200, 40, 40); //Yellow

    fill(136, 73, 189); //Purple Color
    ellipse(520, 200, 40, 40); //Purple

    fill(17, 46, 173); //Blue Color
    ellipse(450, 200, 40, 40); //Blue

    fill(70, 63, 69); //Black Color
    ellipse(590, 200, 40, 40); //Black
}

if ((mouseX > 570)){ //Petal 3
    fill(247, 154, 185); //Pink Color
    ellipse(75, 180, 40, 40); //Pink

    fill(255, 180, 0); //Orange Color
    ellipse(215, 180, 40, 40); //Orange

    fill(191, 63, 63); //Red Color
    ellipse(145, 180, 40, 40); //Red

    fill(31, 144, 0); //Green Color
    ellipse(355, 180, 40, 40); //Green

    fill(255, 234, 0); //Yellow Color
    ellipse(285, 180, 40, 40); //Yellow

    fill(136, 73, 189); //Purple Color
    ellipse(495, 180, 40, 40); //Purple

    fill(17, 46, 173); //Blue Color
    ellipse(425, 180, 40, 40); //Blue

    fill(70, 63, 69); //Black Color
    ellipse(565, 180, 40, 40); //Black
}

if ((mouseX > 555)){ //Petal 4
    fill(247, 154, 185); //Pink Color
    ellipse(60, 225, 40, 40); //Pink

    fill(255, 180, 0); //Orange Color
    ellipse(200, 225, 40, 40); //Orange

    fill(191, 63, 63); //Red Color
    ellipse(130, 225, 40, 40); //Red

    fill(31, 144, 0); //Green Color
    ellipse(340, 225, 40, 40); //Green

    fill(255, 234, 0); //Yellow Color
    ellipse(270, 225, 40, 40); //Yellow

    fill(136, 73, 189); //Purple Color
    ellipse(480, 225, 40, 40); //Purple

    fill(17, 46, 173); //Blue Color
    ellipse(410, 225, 40, 40); //Blue

    fill(70, 63, 69); //Black Color
    ellipse(550, 225, 40, 40); //Black
}

if ((mouseX > 560)){ //Petal 5
    fill(247, 154, 185); //Pink Color
    ellipse(90, 225, 40, 40); //Pink

    fill(255, 180, 0); //Orange Color
    ellipse(230, 225, 40, 40); //Orange

    fill(191, 63, 63); //Red Color
    ellipse(160, 225, 40, 40); //Red

    fill(31, 144, 0); //Green Color
    ellipse(370, 225, 40, 40); //Green

    fill(255, 234, 0); //Yellow Color
    ellipse(300, 225, 40, 40); //Yellow

    fill(136, 73, 189); //Purple Color
    ellipse(510, 225, 40, 40); //Purple

    fill(17, 46, 173); //Blue Color
    ellipse(440, 225, 40, 40); //Blue

    fill(70, 63, 69); //Black Color
    ellipse(580, 225, 40, 40); //Black
}

  if ((mouseX > 550)){ //Flower Centers
    fill(211, 86, 115); //Dark Pink Center
    ellipse(75, 205, 25, 25);

    fill(194, 139, 7); //Dark Orange Center
    ellipse(215, 205, 25, 25);

    fill(160, 38, 38); //Dark Red Center
    ellipse(145, 205, 25, 25);

    fill(21, 99, 0); //Dark Green Center
    ellipse(355, 205, 25, 25);

    fill(220, 202, 0); //Dark Yellow Center
    ellipse(285, 205, 25, 25);

    fill(96, 39, 144); //Dark Purple Center
    ellipse(495, 205, 25, 25);

    fill(8, 32, 132); //Dark Blue Center
    ellipse(425, 205, 25, 25);

    fill(33, 30, 31); //Dark Black Center
    ellipse(565, 205, 25, 25);
  }
//Stems   End
}

1) You can only see the flowers fully grow if you’re looking at the code on a full 640×480 canvas

This project was really difficult for me because there were so many options that I could have done and it was hard for me to really decide what I wanted to code for this project.

These were some initial sketches I did of possible things that I could have attempted to code (unsure if the drawings even make sense), but I decided to try and stick with my theme that I had in my last project, which is the idea of using sprouts. I wanted to try to make the sprouts look like they were growing depending on where the sun is (on the x-axis) and I wanted to change the color of the sky, grass, and the sun depending on where the mouse is (on the x-axis) and also allowing the sun to grow smaller and bigger depending on where it is on the canvas.

It was difficult for me to try and figure out how to code certain things, especially the growing stems for the plants because I tried to do that for my last project. I figured out a way to do it, but I’m sure there is a more efficient way to do it that I want to try and figure out next time.

Another aspect that I wanted to incorporate in this project was to try and draw different flowers like sunflowers, but I found it too difficult to do sadly. Maybe next time.

manuelr – project03 – curtains

sketch

var posx = 20;
var posy = 20;
var posyb = 20;
var posx1 =20;
var posy1 = 20;
var dirX = 1;
var diam = 30;
var falling = 1.1;
var diam1 =30;

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

}

function draw() {
    background (157,156,201);

    for (var x = 5; x < width; x = x+50){
        for (var y = 5; y < height; y = y+50){
            push();
            translate(x, y);
            fill(255,255,102); //yellow            
            ellipse(posx1,posy,diam,diam);
            pop();
        }   
    } 
    //
    if (mouseX > width/2) {
        for (var x = diam; x < width; x = x+50){
            for (var y = diam; y < height; y = y+50){
                push();
                translate(x, y);
                fill(204,255,153);  //green         
                ellipse(-posx1,posy1,diam1,diam1);
                diam1 += .0001;
                pop();
            }   
        } 
    }
    //bluish
    if (mouseX < width/2) {
        for (var x = diam; x < width; x = x+50){
            for (var y = diam; y < height; y = y+50){
                push();
                posyb += falling*0.01;
                posy1+= falling*0.01*-1;
                translate(x, y);
                fill(153,255,255);           
                ellipse(posy1,posy1,diam,diam);
                pop();
            }   
        } 
    }
    // pink
    if (mouseY > height/2) {
        for (var x = diam; x < width; x = x+50){
            for (var y = diam; y < height; y = y+50){
                push();
                posyb += falling*0.01;
                posy1+= falling*0.01*-1;
                translate(x, y);
                fill(255,102,255);           
                ellipse(posx,posyb,diam1,diam1);
                pop();
            }   
        } 
    }
    // orange
    if (mouseY < height/2) {
        for (var x = diam; x < width; x = x+50){
            for (var y = diam; y < height; y = y+50){
                push();
                posyb += falling*0.01*-1;
                posx1 += falling*0.01*1;
                translate(x, y);
                fill(224,96,92);           
                ellipse(posx,posyb,diam,diam);
                pop();
            }   
        } 
    }
}




I wanted to create a curtain of balls that slide through the canvas in an uncomfortable way depending on the direction of the mouse. Are you able to make them dissapear? What if you wait for a little bit?

serinal – project 03 (section C)

sketch

//Serina Liu
//Section C
//serinal@andrew.cmu.edu
//Project-03

var sizex = 320;
var sizey = 240;
var R = 0;
var G = 0;
var B = 0;
var circle = 320;
var dir = 1; 
var speed = 10;
 
function setup() {
  createCanvas(640, 480);
  background (25);

}

function draw() {

    if (mouseX < width*0.44) {
        background (255, 228, 225);
    } else if (mouseX > width*0.6) {
        background (224, 255, 255);
    } else {
        background (255, 215, 0);
    }
    //changing the background color in three different intervals 
    R = 0;
    G = 0;
    B = 0;

    if (mouseX < width*0.44) {
        sizex= 190;
        sizey= 250;
        R= 256;
    } else if (mouseX > width*0.6) {
        sizex= 700;
        sizey= 900;
        B= 256;
    } else {
        sizex=400;
        sizey=470;
        G= 256;
    }
    //size of rectangle changing in three different intervals
    //color of rectangle also changing in three different intervals

    noStroke();
    fill(256, 256, 256);
    ellipseMode (CENTER);
    ellipse (320, 230, circle ,circle);
    //ellipse

    circle += dir*speed;
    if (circle > 550) {
        dir = -dir;
        circle =550;
    } else if (circle < 0) {
        dir = -dir;
        circle = 0;
    }
    //ellipse moving outward and inward

    var rectangle=(width-mouseX);
    fill (R, G, B);
    rectMode (CENTER);
    rect (rectangle, mouseY, sizex/8, sizey/30);
    //mirrors the rectangle in the opposite direction 

    fill(R, G, B);
    rectMode(CENTER);
    rect(mouseX, mouseY, sizex/8, sizey/30);
    //moving rectangle with mouse

}

It is hard to work on motion heavy ones because they tend to give me a headache after looking at them for too long, but I had fun with this one. I think the more practice that I am getting is definitely helping me. I was inspired by a lot of the motion graphics that you see nowadays, with the pastel color backgrounds, whites and then a loud pop of color. I wanted to just focus on the rectangle mainly changing things, but included the ellipse zoom in and out for some added visual simulation.

Project-03

sketch

//Cora Hickoff
//Section D 
//chickoff@andrew.cmu.edu
//Project-03

function setup() {
    createCanvas(640, 480);
    rectMode(CENTER);
    frameRate(10);
}

function draw() {

    //mouseX controls the degrees
    var deg = mouseX;
    var rad = radians(deg);

    background(144,180,180);
    //make background change color
    //when mouse midway point of canvas width
    if (mouseX > (width / 2)) {
        background (232,180,180);
    }

    //small gold circle
    fill(255, 214, 169);
    noStroke();
    //restrict mouseX to 0-135
    var m = max(min(mouseX, 40), 135);
    var size = m * 120.0 / 400.0;
    ellipse(10 + m * 190.0 / 400.0, 200.0, size, size);

    //white circle
    fill(255);
    noStroke();
    //restrict mouseX to 0-400
    var m = max(min(mouseX, 400), 35);
    var size = m * 120.0 / 300.0;
    ellipse(10 + m * 190.0 / 400.0, 200.0, size, size);

    //big gold circle
    fill(255, 214, 169);
    noStroke();
    //restrict mouseX to 0-335
    //mouseX, 920 causes mouseX 
    //to control bid golden circle
    //once white circle overlaps
    var m = max(min(mouseX, 920), 335);
    var size = m * 120.0 / 400.0;
    ellipse(10 + m * 190.0 / 400.0, 200.0, size, size);

    //peach square
    fill(240,140,130);
    //as mouseX moves across
    //canvas, its degrees determine
    //the square's rotation
    rotate(rad);
    rect(300 + m * 190.0 / 400.0, 200.0, size, size);

}

In this project, I wanted to make a shape rotate based on the mouse’s x coordinates. By adding the other ellipses, I realized that the end result made them all look like planets in a solar system and the rectangle looked as though it were orbiting them.