Project-06-aarnavp

For this project, I was inspired by the concept of dendrochronology, which is the study of time depiction through tree rings. Tree rings are indicative not only of the age of the tree, but also the conditions of the climate at the time. I thought this was really interesting, as the from a distance, the time can’t be easily counted, but it depicts more than just time, but place.

The tree ring is comprised of the layered brown/green ring (which denotes 24 layers for 24 hours), and then an underlying minutes and seconds red ring which grows gradually (and doesn’t layer).I also represented days from the moving ellipses in the center of the tree ring, to mimic the idea of celestial bodies.

sketch
//Aarnav Patel
//Section D
//aarnavp@andrew.cmu.edu
//Project 06

//Inspired by dendrochronology (how time is depicted through tree rings)

var radius;
var dayX = [];
var dayY = [];
var degree = [];
var dDegree = []
var diam;

function setup() {
    createCanvas(480, 480);
    let m = month();

    //finding the days per month
	if ( m == 4 || m == 6 || m == 9 || m == 11) {	
		diam = width / 30;
	} else if (m == 1 || m ==3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {		
		diam = width / 31;
	} else {			//february
		diam = width / 28;
	}
    
    radius = width / 60; //for seconds and minutes, they increment evenly 60 times until reach end of canvas
    ringColor = color(random(150, 160), random(105, 155), random(90, 100), 255 / 24);	//opacity is 255/24 so that the center of circle wil eventaully be 100% opacity
    			//random "magic paramters" is for random shade of brown (like tree barks)
    for (var i = 0; i < day(); i++) {
    	append(dayX, diam * i)
    	append(dayY, 0);
    	append(degree, 0);
    	append(dDegree, radians(random(-1, 1)));
    }
}

function draw() {
	background(255);
	translate(width / 2, height / 2);	//set new origin at middle of canvas

	fill(255, 0, 0, 20);	
	drawSecond();
	fill(255, 0, 0, 20);
	drawMinute();
	fill(ringColor);
	drawHour();

	for (var i = 0; i < degree.length; i++) {
		fill(255, 255, 255, 70);		
		ellipse(dayX[i], dayY[i], diam);

		rotate(degree[i]);
		degree[i] = degree[i] + dDegree[i];		//incrementing degree by specific dDegree
	}



}


function drawHour() {					//want the hours rings to be static military time (e.g 24:00) and show circles layered
	for (var i = 0; i < hour(); i++) {	//from 0 to 1 - current hour amount
		noStroke();
		ellipse(0, 0, width / i);		//draws circle proportional to width
	}

}

function drawMinute() {
	ellipse(0, 0, minute() * radius);		//minutes dynamic – increments evenly across canvas

}

function drawSecond() {
	secondR = 8;
	ellipse(0, 0, second() * radius);	//second dynamic – increments evenly across canvas

}


Leave a Reply