aranders-project-04

aranders-project-04

//Anna Anderson
//Section D
//aranders@andrew.cmu.edu
//project-04

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

function draw() {
  background(0, 0, 180);

  var xpoint;
  var ypoint;

//daisy petals

  strokeWeight(1);
  stroke(255);


//top petal
  for (var xpoint = 175; xpoint < 225; xpoint += 3) {
      line(200, 20, xpoint, 150);
  }

//top left petal
  for (var xpoint = 165; xpoint < 230; xpoint += 3.5) {
      line(100, 55, xpoint, 150);
  }

//left petal
  for (var ypoint = 125; ypoint < 175; ypoint += 3) {
      line(55, 150, xpoint - 10, ypoint);
  }

//bottom left petal
  for (var xpoint = 175; xpoint < 230; xpoint += 3.5) {
      line(100, 245, xpoint, 150);
  }

//bottom petal
  for (var xpoint = 175; xpoint < 225; xpoint += 3) {
      line(200, 280, xpoint, 150);
  }

//bottom right petal
  for (var xpoint = 175; xpoint < 230; xpoint += 3.5) {
      line(300, 245, xpoint, 150);
  }

//right petal
  for (var ypoint = 125; ypoint < 170; ypoint += 3) {
      line(340, 150, xpoint - 25, ypoint);
  }

//top right petal
  for (var xpoint = 170; xpoint < 230; xpoint += 3.5) {
      line(295, 55, xpoint, 150);
  }

//daisy center
  noStroke();
  fill(255, 255, 77);
  ellipse(200, 150, 70, 70);

}

I like how my daisy project turned out. The string idea really confused me, but eventually I got the hang of it.

Leave a Reply