monicah1-project-06

sketch

var prevSec;
var millisRolloverTime;

function setup() {
	createCanvas(400, 400);
	ellipseMode(CENTER);
	fill(255);
	noStroke();
}

function draw(){
	background(0);

	var H = hour();
    var M = minute();
    var S = second();

    if (prevSec != S) {
        millisRolloverTime = millis();
    }
    prevSec = S;
    var mils = floor(millis() - millisRolloverTime);

    var rotate1 = TWO_PI * noise(0.005*frameCount + 5);		
	var rotate2 = TWO_PI * noise(0.005*frameCount + 10);
	var rotate3 = TWO_PI * noise(0.005*frameCount + 15);
	var rx = 60 * noise(0.005*frameCount + 10);
	var tx = 200 * noise(0.005*frameCount + 20);
	var volume1 = 200 * noise(0.005*frameCount + 30);
	var volume2 = 50 * noise(0.005*frameCount + 30);

	var secondsWithFraction   = S + (mils / 1000.0);
    var secondsWithNoFraction = S;
    var secondBarWidthChunky  = map(secondsWithNoFraction, 0, 60, 0, width);
    var secondBarWidthSmooth  = map(secondsWithFraction,   0, 60, 0, width);

	translate(width/2, height/2);
	for (var i = 0; i < 10; i++) {
		push();
		rotate(rotate1 + TWO_PI * i / 3);
		translate(tx, 0);
		fill(0,255,60);
		ellipse(0, 0, volume1, volume2);
		for (var j = 0; j < 9; j++) {
			push();
			rotate(rotate2 + TWO_PI * j / 1);
			translate(rx, 0);
			rotate(rotate3);
			fill(250,250,0);
			ellipse(rx, 0, volume2, volume2);
			pop();
		}		
		translate()
		pop();
	}
}

I made a clock based on elements of rotation and noise.

Leave a Reply