Assignment for week 2 is to create a sketch that includes

One element controlled by the mouse.

One element that changes over time, independently of the mouse.

One element that is different every time you run the sketch.

After learning about function Arc, I’m trying to start with drawing a spiral line. I can draw several small arc frame by frame to create a spiral line.

SpiralLine

function setup() {
 createCanvas(600,400);
 angleMode(DEGREES);
 w=10;h=10;start=0;stop=1;t=0.1;b=38;
}
function draw() {
 strokeWeight(5);noFill();stroke(r,g,b);
 r=random(38,250);
 g=random(38,250);
 arc(300,200,w,h,start,stop);
 start=start + 1.5;
 stop=stop + 1.5;
 w= w + t;
 h= h + t;
}

Then I think the spiral line looks like an eye, and two spiral with one nose would be really interesting:

face

Now adding some change that control by mouse. When mouse move to nose, cause the nose turn red and bigger.

Here is the final link:

OR PRESS HERETO PLAY!!!

Leave a Reply

Your email address will not be published. Required fields are marked *