int s; int h; void setup(){ size(900,800); smooth(); } void draw(){ background(174,223,224); translate(width/2,height/2); rectMode(CENTER); ellipseMode(CENTER); s= second(); h= hour(); //Digital Clock fill(255,10,125); textSize(20); text(hour() + " : " + minute() + " : " + second(), 60, 320); text("Second: Trunk Rotates ", 60, 340); text("Minute: Tusks Increase Transparency ", 60, 360); text("Hour: Tail Rotates ", 60, 380); //Elaphent Tail(Showing the hour) pushMatrix(); rotate(h); noFill(); stroke(0); strokeWeight(10); curve(300, -300, 0, -400, 0, 60, -200, -50); fill(0); ellipse(0,-400, 30, 30); popMatrix(); //Ear of the Elephant noStroke(); fill(#E3D3D3); ellipse(-200,-110,240,400); ellipse(200,-110,240,400); //Shade of the ear fill(#F7F0F0); ellipse(200,-110,180,320); ellipse(-200,-110,180,320); //Elephant Face fill(#E3D3D3); noStroke(); ellipse(0,-120,400,400); //The Face fill(#151313); ellipse(100,-190,80,90); //Right Eye(Black) fill(#FFFFFF); ellipse(100,-190,20,30); //Right White Eye fill(#151313); ellipse(-100,-190,80,90); //Left Eye(Black) fill(#FFFFFF); ellipse(-100,-190,20,30); //Left White Eye //Mouth stroke(0); strokeWeight(4); noFill(); //arc(0, 130, 100, 60, 0, (HALF_PI)*2); line(0,70,-50,20); line(0,70,50,20); //Tusk (The colour changes) stroke(255); strokeWeight(1); fill(255,10,125,s); triangle(-100,80,-120,0,-80,0); triangle(100,80,120,0,80,00); //elephant trunk if( second() % 4 < 1 ){ rotate(map(second()%1,0,1000,0,radians(-30))); fill(#F7F0F0); noStroke(); rect(0, 0, 80, 300, 12, 12, 30, 30); //rect(30, 116, 60, 38, 50, 50, 50, 50); } else if( second() % 4 < 2 ){ rotate(map(second()%1,0,1000,radians(-30),0)); fill(#F7F0F0); noStroke(); rect(0, 0, 80, 300, 12, 12, 30, 30); //rect(30, 116, 60, 38, 50, 50, 50, 50); } else if( second() % 4 < 3 ){ rotate(map(second()%1,0,1000,0,radians(30))); fill(#F7F0F0); noStroke(); rect(0, 0, 80, 300, 12, 12, 30, 30); //rect(30, 116, 60, 38, 50, 50, 50, 50); } else { rotate(map(second()%1,0,1000,radians(30),0)); fill(#F7F0F0); noStroke(); rect(0, 0, 80, 300, 12, 12, 30, 30); //rect(30, 116, 60, 38, 50, 50, 50, 50); } }