Project – 03

sketch

sketch

function setup() {
    createCanvas(600, 450);
}

function draw(){
    background(60,179,113);

    translate(width/2, height/2);
    for (var BE = 0; BE < 12; BE++) {       //12 big ellipses rotating themselves 
        push();
        rotate(TWO_PI * BE / 12);
        var tx = 200 * mouseX/600;
        rotate(radians(frameCount))
        translate(tx, 0);
        fill(46, 79, 79, 200)
        ellipse(0, 0, 20, 40);
            push()
            strokeWeight(7.5)
            line(0, 0, 100, 100)    //sticks jutting out of the big ellipses
                push()
                rotate(frameCount/50)
                strokeWeight(5)
                translate(100, 100)
                line(-200, 100, 100, 50)    //thinner sticks almost perpindicular to the above ones
                pop()           //if I get rid of pop here, some really crazy things happen
            pop()
        for (var SE = 0; SE < 8; SE++) {    //8 small ellipses going in a circular line around each big ellipse
            push();
            rotate(TWO_PI * SE / 8);
            var rx = 60 * mouseY/450;
            rotate(radians(frameCount))
            fill(200, 0, 0, 150)
            ellipse(rx, 0, 8, 16);
            for (var SS = 0; SS < 8; SS++) {
                push();
                rotate(TWO_PI * SS / 8);
                var sx = 60 * mouseY/450;
                rotate(radians(frameCount))
                square(sx, 0, 8);
                pop(); }
            pop();
              }       
        pop();
    }
}

Leave a Reply