Janet Lee-Project 3- Dynamic Drawings

sketch

var diamOne = 150;
var diamTwo = 100;
function setup() {
    createCanvas(640,480);


}

function draw() {
    background ("#3D3355");
  fill ("#F13F5F");

  push();//small flower spinning
  translate(width/3,height/3+100);
  rotate (millis()/1000);
  translate(-width/3,-height/3+100);
  rotate(radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate(radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate(radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  noStroke();
  ellipse (0,0,10,80);
  rotate (radians(15));
  pop();
  push();
  fill("#C2AFC7");
  noStroke();
  ellipse (width/2+100,height/2-100,diamOne);
  pop();
  push();
  fill("#E790A5");
  noStroke();
  ellipse (width/2+50,height/2+150,diamTwo);
  pop();
    if (mouseY>height/2) { //changes size of diamOne
      diamOne -= (diamOne-5)>=15;
    } else {
      diamOne += (diamOne+5)>=100;
    }
    if (mouseX >width/2) {//changes sizes of diamTwo
      diamTwo += (diamTwo+10)> 30;

    } else {
      diamTwo -= (diamTwo-10)>50;
    }



}

Leave a Reply