Project 11 – Moving Landscape

The project is a relaxing view of sunset in an air balloon – if you take the time to watch the full animation, you can see the colors of the sky, sun, and clouds change as well through gradual RGB changes and color theory. I wanted a lowpoly style animation, and worked to get effect through the “shifting clouds”

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

var r = 140;
var g = 200;
var b = 230;
var cloudR = 255;
var cloudG = 255;
var cloudB = 255;
var sunX;
var sunY = 0; 
var sunR = 255;
var sunG = 247;
var sunB = 197;
var sunSize = 50;


var airBalloons = [];
var clouds = [];
var sceneCount = 0;
var bPics = ["https://i.imgur.com/El159Qi.png", "https://i.imgur.com/Inz2K7i.png", "https://i.imgur.com/IjQkLRr.png"]
var balloons = []

function preload() {
	//load the images
	for (var i = 0; i < bPics.length; i++) {
		balloons.push(loadImage(bPics[i]));
	}
}

function setup() {
    createCanvas(480, 200);
    sunX = width;
  	frameRate(10);

}

function draw() {

	var sky = color(r, g, b);
	fill(sky);
	rect(0, 0, width, height);


	//sky color change
	if (r < 255) {
		r += 0.1

	} 
	if (g > 150) {
		g -= 0.1;

	} 
	if (b > 87) {
		b -= 0.1;

	}

	//sky grandient
	for (var i = 0; i < 50; i+= 0.5) {
		stroke(r + i, g + i, b + i);
		var amount = map(i * 2, 0, 100, height * 0.75, height);
		line(0, amount, width, amount);
	}

	//SUN 
	if (sunR > 242) {
		sunR -= 0.1;
	}
	if (sunG > 60) {
		sunG -= 0.1;
	}
	if (sunB > 10) {
		sunB -= 0.1;
	}

	noStroke();
	fill(sunR, sunG, sunB);
	ellipse(sunX, sunY, sunSize, sunSize)

	sunX -= 0.25;
	sunY += 0.1;
	sunSize += 0.01;


	//cloud color change
	if (cloudR >= 244) {
		cloudR -= 0.05;
	}
	if (cloudG >= 223) {
		cloudG -= 0.05;
	} 
	if (cloudB > 208) {
		cloudB -= 0.05;
	}
	generateClouds();
	generateAirBalloons();


	updateClouds();
	updateBalloons();
	sceneCount++;

}

function makeCloud(stormCloud) {
	var cloud = {
		cX: random(0, 1.5 * width), cY: random(0, height), cDx:0, 
		cW: random(100, 300), 
		isStorm: stormCloud,
		show: drawCloud, 
		move: moveCloud, 
	}
	return cloud;
}


function drawCloud() {
	noStroke();
	var xInterval = this.cW / 8; //makes sure the x points never exceed the assigned cloudWidth
	var xPoint = this.cX
	var yPoint = this.cY

	//foreground clouds are lightest
	if (this.cW > 200) {
		this.cDx = 5;
		fill(cloudR, cloudG, cloudB, 255);
	} else if (this.cW > 100){	//midGround are slightly opaque
		fill(cloudR, cloudG, cloudB, 200)
		this.cDx = 3;
	} else {
		fill(cloudR, cloudG, cloudB, 100);	//background are most opaque
		this.cDx = 1;
	}
	//checks if its storm cloud
	if (this.isStorm) {
		fill(200, 255);
		
	}


	//generating points for the lowPoly Clouds
	var y = [yPoint, yPoint - 15, yPoint - 20, yPoint - 15, yPoint, yPoint + 15, yPoint + 20, yPoint + 15];
	//Y points are fixed
	var x = [xPoint];
	for (var i = 0; i < 8; i++) {
		if (i < 4) {
			xPoint += xInterval
		} else {
			xPoint -= xInterval
		}
		x.push(xPoint);
		

	}


		//gives animating effect
		for (var i = 0; i < x.length; i++) {
			x[i] += random(-5, 5);
			y[i] += random(-5, 5);
		}



	//draw cloud based on array made
	beginShape();
	for (var i = 0; i < x.length; i++) {
		vertex(x[i], y[i]);
	}
	endShape(CLOSE);

}


function moveCloud() {
	//updates cloudX by its speed
	this.cX -= this.cDx;

	//when cloudX is off left of screen, assigns it new position
	if (this.cX + this.cW < 0) {	//checks right side of cloud
		this.cX = random(width, 1.5 * width);
		this.cY = random(0, height / 1.5);
	}
}


function updateClouds() {
	//moves all the clouds from global cloud array
	for (var i = 0; i < clouds.length; i++) {
		clouds[i].move();
		
	}
}

function generateClouds() {
	//creates clouds with a 1/8 chance of a cloud being a storm cloud
	var isStorm = false;
	for (var i = 0; i < 15; i++) {
		
		if (amount = Math.floor(random(1, 8)) == 2) {
			isStorm = true;
		}
    	var c = makeCloud(isStorm);
    	clouds.push(c);
    	clouds[i].show();
    	isStorm = false;
    }
}

function generateAirBalloons() {
	//generates air balloons from image I have
	for (var i = 0; i < 10; i++) {
		var b = makeBalloon()
		airBalloons.push(b);
		airBalloons[i].show();
	}
}

function makeBalloon() {
	var b = {
		bX: random(0, width), bY: random(height * -5, height),
		bDx: Math.floor(random(-4, 4)), bDy: Math.floor(random(2, 4)),
		bImage:  Math.floor(random(0, 3)),	//ranodm number to select the type of balloon image
		ratio: Math.floor(random(0, 2)),
		show: drawBalloon, 
		float: floatBalloon,
	}

	return b;
}

function updateBalloons() {
	for (var i = 0; i < airBalloons.length; i++) {
		airBalloons[i].float();
	}
}

function floatBalloon() {
	this.bX += this.bDx;
	this.bY += this.bDy;

	if (this.bY > height) {
		this.bY = random(height * -5, height * -0.25);
		this.bX = random(0, width);
	}

}

function drawBalloon() {
	image(balloons[this.bImage], this.bX, this.bY, balloons[this.bImage].width * this.ratio, balloons[this.bImage].height * this.ratio);
}

Looking Outwards 11-Racial Bias in AI

The article AI & Creativity: Addressing Racial Bias in Computer Graphics discusses a topic brought up by Theodore Kim at SIGGRAPH 2021. Kim asserts that algorithms used for human computer generated images have encoded racial biases that reflect in the final outcome, and are being propagated in more forms of CG AI – a dangerous seed in spreading racial bias within society. Specifically, Kim talks about the subsurface light transport feature that CG artists use to give a realistic glow to their characters. While it reflects well in white figures, it produces inaccurate results when translated to darker skinned ones, as they have an observed shine to their skin surface. The same can be applied with the variety in hair textures, and the accuracy with portraying different hairs/defaulting to blonde hair. The issue with this is that algorithms are programmed to more accurately depict lighter skinned individuals compared to darker ones, creating a bias for CG artists to choose the first when doing these projects. Kim’s call to action is for these artists to be more conscious of their encoded racial biases, and make the effort to develop diversity with their own works. It was especially interesting when the comparison was brought up in regards to fine arts, and how artists had to “learn” to paint darker skinned people as there was a lack of exposure during their education.

https://nettricegaskins.medium.com/ai-creativity-addressing-racial-bias-in-computer-graphics-f5fc0c255e7

Project 09 – Project

The photo is a baby photo of myself, so I wanted to use really “primitive” shapes of squares, rhombuses, and circles (all regular shapes).

One of the most satisfying aspects of pointilist pieces is the process of it being made. I wanted this project to be interactive for the user, and really engage with the idea of “pointilism,” so the shapes are made where your mouse is on the canvas.

Additionally, if you press the mouse, you will invert the colors of the original photo, allowing for a “duality” of images being made on the same canvas.

sketch
//Aarnav Patel
//Section D
//Project

var shapeNum = 1;
var c = [];	//getPixel returns an array
var inverseColor = false;

function preload() {
	portrait = loadImage("https://i.imgur.com/aUtMs8f.png");
}

function setup() {
	createCanvas(480, 480);
	background(0);
	imageMode(CENTER);
	portrait.loadPixels();
}

function draw() {
  noStroke();

  var mX = constrain(mouseX, 0, portrait.width);	
  var mY = constrain(mouseY, 0, portrait.height);	//Constrain shapes to happen within canvas

  var x = floor(Math.floor(random(mX - 50, mX + 50)));
  var y = floor(Math.floor(random(mY - 50, mY + 50)));	//Creates "brush" radius of 50 
  c = portrait.get(x, y);

  if (inverseColor) {		//Inverses color by changing array valleus from portrait.get()
  	c[0] = 255 - c[0];
	c[1] = 255 - c[1];
	c[2] = 255 - c[2];
  }
  shapeNum = Math.floor(random(0, 2));	//Creates random indicator for whetehr its square or circle
  fill(c, 128);
  if (shapeNum == 0) {
  	ellipse(x, y, 20, 20);
  } else if (shapeNum == 1) {
  	push();					//Translate + rotate square about its center
  	translate(x, y);
  	rotate(radians(random(0, 360)));
  	rectMode(CENTER);
  	rect(0, 0, 20, 20);
  	pop();
  } 
}

function mousePressed() {
	inverseColor = !inverseColor;
}



Looking Outwards 9 – Emily Gobeille

One project that stood out to me was Emily Gobeille’s Night Bright. Andrea is the cofounder of Design I/O, which specializes in immersive spaces and interactions for museums to create new modes of learning and storytelling. Emily primarily studied motion, graphics, print, and game design, disciplines that all solidified her ability to reimagine how information can be conveyed within a space. Her focus on meaningful interactions is something that especially resonates with me, as I’m pursuing environments concentration in the School of Design, which looks at the same key concepts she focuses on of interaction and immersive hybrid spaces.

What’s especially interesting about Gobeille’s work, is her emphasis on children as an audience. Working with such an audience requires a lot of creativity on meaningful interactions – how do children interact with a space? What sparks curiosity within a child/encourages them to further interact with a space? Moreover, how can the content displayed be effectively used to immerse the child beyond just the “viewing” experience.

Website: http://zanyparade.com/
Night Bright Project: https://www.design-io.com/projects/nightbright

Looking Outwards 08 – aarnavp

Mohit Bhoite is a senior hardware engineer at Particle, where he designs and builds their flagship Internet of Things products, focusing on freeform circuit boards for sculpture and art pieces. He focused his education in robotics, specifically the discipline of modular robotics, which has influenced his art practice of free form kinetic sculptures.

Mohit’s work cleverly approaches the complex field of robotics and circuit board building, which is seen as a very strict practice. In his lecture, Mohit describes the duality behind his practice and traditional circuit board design, where his aligns with the concept of rapid prototyping, and appreciating the artistic intentions that occur when working without the constraints of “industry standards” such as 3D printing/mass production of circuits. I especially liked how he manages to incorporate aesthetic into his design, as he says he drew inspiration from stained glass in his circuit board designs – specifically his Tye Fighter alarm clock.

It’s very interesting how he approaches circuit boards as its own medium, looking at the materiality of them in shaping his practices – this iterative process is often very much used with artists and can definitely be applied to these more formal practices.

https://www.bhoite.com/

Looking Outwards 07 – Data Visualization

One data visualization project that really impressed me is the work of Chris Harrison piece Word Associations Visualizing Google Bi-Gram Data. The piece portrays words on a spectrum based on a frequency. It definitely relates to the notion of arrays and traversing through different groups of data and finding different calculations (namely average and mode I’m assuming). This piece really stuck to me because it touches on a cultural/linguistic phenomenon of word association, and how the frequency of words contribute to its societal perception/usage (a feedback loop that directly influences how much a word is used).

What I especially appreciate about this piece is how natural the integration with technology and graphics was undertaken. The whole point of data visualization is to present information in a more impactful and comprehensible way. While there are many ways the idea of frequency of a list can be pretty standard, the way they organize the words in a curved composition with focal points towards the edges of the canvas really draws your eyes to see all the words and the transition between them.


https://www.chrisharrison.net/index.php/Visualizations/WordAssociations

Project 07 – Composition with Curves

Inspiration by Epicycloid Function

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

var n = 1000;
var c;

function setup() {
    createCanvas(480, 480);
    c = color(random(255), random(255), random(255));

}

function draw() {
	background(0);
	for (var i = 0; i < 3; i++) {
		drawSpiral(i * width / 2);			//draws three times
	}

}

function mousePressed() {
	c = color(random(255), random(255), random(255));
}

function drawSpiral(w) {
	stroke(c);
	push();
	translate(w, height / 2);	//Setting the origin
	noFill();
	var x;
	var y;
    var a = constrain(mouseX, 0, width);		
    var b = constrain(mouseY, 0, height);		//Constrains aim to keep proportional when mouse is in Canvas

	
	strokeCap(ROUND);
    strokeJoin(ROUND);
    var t = 0;

    beginShape();					//Starting shape before vertices inputted
	for (var i = 0; i < n; i++) {							
		var t = map(i, 0, n, 0, TWO_PI);
		x = (a + b) * cos(t) - b * cos((a + b / b) * t);		//Using the elipcycloid function for the x and y (cos and sin)
		y = (a + b) * sin(t) - b * sin((a + b / b) * t);
		vertex(x, y);

	}
	endShape();					//ending the shape
	pop();						//resetting for the next time its called

}




/*

function drawSpiral() {
	//x	=	(a+b)cosphi-bcos((a+b)/bphi)

	//=	a^2[cos(2theta)+/-sqrt((b/a)^4-sin^2(2theta))].

	noStroke();
	var a = mouseX / 4;
	var b = 50;

	strokeCap(ROUND);
	strokeJoin(ROUND);
	var t = 0;
	push();
	translate(width / 2, height / 2);
	if (a > b) {
		//push();
		beginShape();
		for (var i = 0; i < n; i++) {
			t = map(i, 0, n, 0, TWO_PI);
			var r = sqrt(a * a * ( cos(t) + sqrt(pow((b / a), 4) - pow(sin(2 * t), 2))));

			var x = r * cos(t);
			var y = r * sin(t);
			console.log(x + ", " + y)

			vertex (-x, y);
		}
		endShape();
		//pop();
	}
		
	//push();
	beginShape();
	for (var i = 0; i < n; i++) {
		t = map(i, 0, n, 0, TWO_PI);
		var r = sqrt(a * a * ( cos(t) + sqrt(pow((b / a), 4) - pow(sin(2 * t), 2))));

		var x = r * cos(t);
		var y = r * sin(t);
		console.log(x + ", " + y)

		vertex(x, y);
	}
	endShape();
	pop();
}
*/

Looking Outward – 06 – aarnavp

//Aarnav Patel
//aarnavp@andrew.cmu.edu
//Section D
//Looking Outwards

One random computational graphics project that really impressed me is the work of Anders Hoff in the piece A Tangle of Webs. While there is definitely the employment of certain algorithms, the start of the piece is created from scattering random vertices around the canvas. The preceding formula then uses a recursive method to track intersections of lines connecting these vertices, ultimately resulting in the organic web-like structure. The resulting form is also inspired by elastic bands, as they model certain interactions between adjacent nodes to create the elastic materiality effect.

What I especially appreciate about this piece is how natural the integration with technology and graphics was undertaken. The potential for this type of piece is even noted for how it can be applied in a 3D sphere. It really connects with some of the projects we do in class, as we can somehow create this generalized algorithms from a basis of random points, alluding to the mathematical concepts underlying randomness.

https://inconvergent.net/2019/a-tangle-of-webs/

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

}


Looking Outwards 05 – Computational Graphics

One computational graphics project that really impressed me is the work of Vincent Pace and James Cameron in the film Avatar. The movie, released in 2009, was critically acclaimed for its advanced usage of CGI and how it advanced CG technologies that set precedent to sci-fi movies later to come. The usage of stereoscopic cameras and rigging actors with gear to mimic human eyes. 60% of the film utilized CGI imagery, as the film integrates CGI with live action recording as well – each second in the film contains about 17 gigabytes of data.

What I especially appreciate about this piece is how natural the integration with technology and graphics was undertaken. It’s always a risk to “overcompute” a creative practice within these types of projects, which undermine the realistic nature of the scenery. However, the project revolutionized how the movie industry can be taken further through CGI.


The Evolution of Animation to CGI (Computer-Generated Imagery) and the Impact of James Cameron’s Avatar