Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
/*
Strange Dog
Adrian Cogswell

PROG14998 2018
assignment 1: interactive drawing
*/  

  //set window size
void setup() {
  size(400, 400);

}

void draw(){
  //setup
  background(130, 147, 157);
  noStroke();
  rectMode(CORNERS);

//CLOUDS - MOVE BASED ON MOUSE'S X POSITION
  
  fill(225, 220, 212, 100);//lgtbeige
    rect(40-mouseX/2, 40, 150-mouseX/2, 95, 80);
    rect(120+mouseX/2.5, 70, 230+mouseX/2.5, 85, 100);
    rect(mouseX/.5-90, -30, 80+mouseX/.5, 100, 50);
    rect(210+mouseX/2, 10, 320+mouseX/2, 60, 80);
    rect(400-mouseX, 20, 510-mouseX, 75, 100);
  
  
//BODY+CUTOUTS - BODY + TAIL WILL BREATHE IN AND OUT CONSTANTLY

  
//tail
  fill(183, 169, 143);//medbeige
    ellipse(300, 145+4*cos(frameCount*.1), 70, 70);//tailbase
  fill(130, 147, 157);//bgblue
    ellipse(290, 135+4*cos(frameCount*.1), 60, 60);//tailcutout
  
//legs + torso  
  fill(183, 169, 143);//medbeige
    ellipse(115, 160, 33, 33);//lshoulder
    triangle(36, 205, 123, 173, 103, 149);//lbicep
  fill(225, 220, 212);//lgtbeige
    ellipse(210, 220, 200, 200+4*sin(frameCount*.1));//torsobase
  fill(130, 147, 157);//bgblue
    ellipse(215, 260, 170, 170);//torsobasecutout
  fill(225, 220, 212);//lgtbeige
    ellipse(170, 200, 80, 80);//ribcagebase
    ellipse(300, 260, 100, 100);//hindthighs
  fill(183, 169, 143);//medbeige
    ellipse(300, 275, 100, 100);//hindthighs
  fill(130, 147, 157);//bgblue
    ellipse(300, 295, 85, 85);//hindthighscutout
  
  fill(106, 102, 100);///bgbrown
    rect(0, 300, 400, 400);//ground
  
//rib depresses 
  stroke(194, 131, 83);//orange
    line(170, 240, 180 ,205);
    line(185, 235, 195, 200);
    line(200, 225, 210, 190);
  noStroke();


//LEGS - COMPLETELY STATIONARY


  fill(183, 169, 143);//medbeige

  //hind
    triangle(343, 300, 343, 272, 320, 272);//rhind2ndjoint
    triangle(257, 300, 257, 272, 280, 272);//lhind2ndjoint
  fill(130, 147, 157);//bgblue
   rect(0, 293, 400, 310);//kneecutoff
  fill(183, 169, 143);//medbeige
    rect(320, 272, 330, 320);//rhind3rdjoint
    rect(270, 272, 280, 320);//lhind3rdjoint
//front
    ellipse(170, 160, 33, 33);//rshoulder
    triangle(225, 235, 185, 154, 157, 170);//rbicep
    ellipse(225, 235, 25, 25);//relbow
    quad(235, 242, 225, 320, 200, 320, 213, 238);//rforeleg
    ellipse(36, 205, 25, 25);//lelbow
    rect(23.5, 205, 48.5, 320);//lforeleg

//feet
  fill(225, 220, 212);//lgtbeige
    ellipse(205, 320, 40, 25);//rfrontfoot
      ellipse(43.5, 320, 40, 25);//lfrontfoot
    ellipse(330, 320, 20, 25);//rbackfoot
      ellipse(270, 320, 20, 25);//lbackfoot
  fill(106, 102, 100);///bgbrown
    rect(0, 320, 400, 400);//footcutout

//collar
  fill(66, 64, 75);//drkblue
    quad(125, 200, 155, 245, 145, 245, 125, 215);//rsidecollar
      quad(125, 200, 95, 245, 105, 245, 125, 215);//lsidecollar
  fill(81, 140, 173);//lgtblue - collarstuds
    ellipse(135, 216, 8, 8);//stud1
    ellipse(114, 216, 8, 8);//stud2
    ellipse(146, 232, 8, 8);//stud3
    ellipse(103, 232, 8, 8);//stud4

 //tongue
  fill(194, 131, 83);//orange
    rect(110, 270, 140, 270+0.25*mouseY);//tonguebase
    ellipse(125, 270+0.25*mouseY, 30, 30);
  stroke(130, 104, 85);//drkorange
  strokeWeight(5);
    line(125, 270, 125, 270+0.25*mouseY);  
  noStroke();

//head
  fill(183, 169, 143);//medbeige
    ellipse (160, 280+.8*sin(frameCount*.1), 70, 70);//rcirc
    ellipse (90, 280+.8*sin(frameCount*.1), 70, 70);//lcirc
    rect(90, 245+.8*sin(frameCount*.1), 160, 280+4*sin(frameCount*.1));//connector

//eyes
  fill(225, 220, 212);//lgtbeige
    ellipse(170, 285+.8*sin(frameCount*.1), 30, 30);//righteyebase
    ellipse(80, 285+.8*sin(frameCount*.1), 30, 30);//leyebase
    ellipse(170, 285+.8*sin(frameCount*.1), 38, 8);//reyecorners
    ellipse(80, 285+.8*sin(frameCount*.1), 38, 8);//leyecorners
  fill(194, 131, 83);//orange - orange iris level
    ellipse(173-.8*sin(frameCount*.1), 283+.8*cos(frameCount*.1), 20, 20);//riris1
    ellipse(77+.8*sin(frameCount*.1), 283+.8*cos(frameCount*.1), 20, 20);//liris1
  fill(81, 140, 173);//lgtblue - blue iris level
    ellipse(174-.8*sin(frameCount*.1), 281+.8*cos(frameCount*.1), 15, 15);//riris2
    ellipse(76+.8*sin(frameCount*.1), 281+.8*cos(frameCount*.1), 15, 15);//liris2
  fill(66, 64, 75);//drkblue - pupil level
    ellipse(173-.8*sin(frameCount*.1), 282+.8*cos(frameCount*.1), 10, 10);//rpupil
    ellipse(77+.8*sin(frameCount*.1), 282+.8*cos(frameCount*.1), 10, 10);//lpupil
    triangle(125, 280+.8*sin(frameCount*.1), 115, 270+.8*sin(frameCount*.1), 135, 270+.8*sin(frameCount*.1));//nose

//ear
  fill(105, 96, 89);//drkbrown - ear level
    ellipse(180, 245+.8*sin(frameCount*.1), 35, 35);//rcirc
    ellipse(70, 245+.8*sin(frameCount*.1), 35, 35);//lcirc
    rect(162.5, 227+.8*sin(frameCount*.1), 197.5, 245);//rrect
    rect(52.5, 227+.8*sin(frameCount*.1), 87.5, 245);//lrect
  
//DOGBONE CURSOR - FLOAT AROUND CURSOR POSITION

//outline
  fill(130, 104, 85, 50);//drkorange
    rect(mouseX+5*sin(frameCount*.05)-18, mouseY+5*sin(frameCount*.1)-8, 18+mouseX+5*sin(frameCount*.05), 8+mouseY+5*sin(frameCount*.1));
    ellipse(mouseX+5*sin(frameCount*.05)-15, mouseY+5*sin(frameCount*.1)-5, 16, 16);
    ellipse(mouseX+5*sin(frameCount*.05)+15, mouseY+5*sin(frameCount*.1)-5, 16, 16);
    ellipse(mouseX+5*sin(frameCount*.05)-15, mouseY+5*sin(frameCount*.1)+5, 16, 16);
    ellipse(mouseX+5*sin(frameCount*.05)+15, mouseY+5*sin(frameCount*.1)+5, 16, 16);
//fill  
  fill(194, 131, 83);//orange
    rect(mouseX+5*sin(frameCount*.05)-15, mouseY+5*sin(frameCount*.1)-5, 15+mouseX+5*sin(frameCount*.05), 5+mouseY+5*sin(frameCount*.1));
    ellipse(mouseX+5*sin(frameCount*.05)-15, mouseY+5*sin(frameCount*.1)-5, 10, 10);
    ellipse(mouseX+5*sin(frameCount*.05)+15, mouseY+5*sin(frameCount*.1)-5, 10, 10);
    ellipse(mouseX+5*sin(frameCount*.05)-15, mouseY+5*sin(frameCount*.1)+5, 10, 10);
    ellipse(mouseX+5*sin(frameCount*.05)+15, mouseY+5*sin(frameCount*.1)+5, 10, 10);
  fill(66, 64, 75);//drkblue
    rect(5+mouseX+5*sin(frameCount*.05), mouseY+5*sin(frameCount*.1)-5, 10+mouseX+5*sin(frameCount*.05), 5+mouseY+5*sin(frameCount*.1));
}