Project 11

For my generative landscape, I chose to make a desert with different types of cacti whose sizes and colors are randomly generated. For the sand and hills in the back, I referenced the lab from week 7. While the sand keeps moving, the hills in the back are still but change every time the page is refreshed.

zimmy desert
var cacti = [];
var canyons = [];
var sand = [];
var ball = [];
var noiseParam = 0;
var noiseStep = 0.02;

function setup() {
    createCanvas(640, 240); 
    background(0);

    
    /*// create an initial collection of buildings
    for (var i = 0; i < 10; i++){
        var rx = random(width);
        buildings[i] = makeBuilding(rx);
    }*/
    frameRate(20);
    //canyon values
    for(var i = 0; i <= width/5; i++){
        var n = noise(noiseParam);
        canyons[i];
        var value = map(n, 0, 1, 0, height);
        canyons.push(value);
        noiseParam += noiseStep;
    }
    //sand values
    for(var i = 0; i <= width/5; i++){
        var n = noise(noiseParam);
        sand[i];
        var value = map(n, 0, 1, 0, height/2);
        sand.push(value);
        noiseParam += 0.5*noiseStep;
    }

}


function draw() {
    //sunset gradient
    var gradRed = color(190, 60, 38); // darker red color
    var gradYellow = color(250, 185, 21); // yellow
    for (var i = 0; i < height; i++){
        var gradient = map (i, 0, (height/3)*1.5, 0, 1);
        var bgColor = lerpColor(gradRed, gradYellow, gradient);
        stroke(bgColor);
        line(0, i, width, i);
    } 
    // draw a setting sun
    push();
    noStroke();
    fill(255, 226, 161);
    circle(500, 110, 180);
    pop();
    
    drawCanyons();
    drawSand();

    // taller cacti
    updateAndDisplayCacti();
    removeCactiThatHaveSlippedOutOfView();
    addNewCactiWithSomeRandomProbability(); 
    

    updateAndDisplayBalls();
    removeBallsThatHaveSlippedOutOfView();
    addNewBallsWithSomeRandomProbability(); 




}

//draws background canyons (still)
function drawCanyons(){
    // canyon values
    var n = noise(noiseParam);
    var value = map(n, 0, 1, 0, height);
    noiseParam += noiseStep;
    // draws shape for canyons
    beginShape();
    vertex(0, height);
    for(var i = 0; i <= width/5; i++){
        //filling the canyons with translucent brown
        fill(178, 108, 55, 180);
        noStroke();
        //vertex function to fill the canyon
        vertex((i * 5), canyons[i]); 
        vertex((i + 1) * 5, canyons[i + 1]);   
    }
    vertex(width, height);
    endShape(CLOSE);
}

// draws sand (moving)
function drawSand(){
    push();
    translate(0, 130)
    sand.shift();
    var n = noise(noiseParam);
    var value = map(n, 0, 1, 0, height/2);
    sand.push(value);
    // draws shape for sand
    beginShape();
    vertex(0, height);
    for(var i = 0; i <= width/5; i++){
        //filling the sand color
        fill(237, 197, 154);
        noStroke();
        //vertex function to fill the sand
        vertex((i * 5), sand[i]); 
        vertex((i + 1) * 5, sand[i + 1]);   
    }
    vertex(width, height);
    endShape(CLOSE);
    pop();
}



function updateAndDisplayCacti(){
    // Update the building's positions, and display them.
    for (var i = 0; i < cacti.length; i++){
        cacti[i].move();
        cacti[i].display();
    }
}


function removeCactiThatHaveSlippedOutOfView(){
    var cactiToKeep = [];
    for (var i = 0; i < cacti.length; i++){
        if (cacti[i].x + cacti[i].breadth > 0) {
            cactiToKeep.push(cacti[i]);
        }
    }
    cacti = cactiToKeep; // remember the surviving buildings
}


function addNewCactiWithSomeRandomProbability() {
    // With a very tiny probability, add a new building to the end.
    var newCactusLikelihood = 0.02; 
    if (random(0,1) < newCactusLikelihood) {
        cacti.push(makeCactus(width));
    }
}


// method to update position of cactus every frame
function cactusMove() {
    this.x += this.speed;
}
    

//draw the cactus
function cactusDisplay() {
    cacti.push();
    strokeWeight(25);
    stroke(this.color);

    //main stalk
    var y = 220;
    line(this.x, this.cBottom, this.x, this.cBottom-this.cHeight)
    strokeWeight(17);
    stroke(204, 209, 135, 60);
    line(this.x, this.cBottom, this.x, this.cBottom-this.cHeight)

    // two stalks on side
    strokeWeight(13);
    stroke(this.color);
    line(this.x-20, this.cBottom-this.s1Bottom, this.x-20, this.cBottom-this.s1Height); 
    // left stalk has a random height
    line(this.x+20, this.cBottom-this.s2Bottom, this.x+20, this.cBottom-this.s2Height); 
    // right stalk has a random height
}



// makes taller cacti
function makeCactus(birthLocationX) {
    var ccts = {x: birthLocationX,
                breadth: 50,
                speed: -4.5,
                cHeight: random(30, 60), // height of cactus
                cBottom: random(200, 225), // bottom of cactus
                s1Height: random(20, 60), // top of the left stalk
                s1Bottom: random(5, 20), // bottom of left stalk
                s2Height: random(20, 60), // top of right stalk
                s2Bottom: random(5, 20), // bottom of right stalk
                
                color: color(random(40, 100), random(80, 200), 72), // varies shades of green
                move: cactusMove,
                display: cactusDisplay}
    return ccts;
}

function addNewBallsWithSomeRandomProbability() {
    // With a very tiny probability, add a new building to the end.
    var newBallLikelihood = 0.02; 
    if (random(0,1) < newBallLikelihood) {
        ball.push(makeBall(width));
    }
}

function updateAndDisplayBalls(){
    // Update the building's positions, and display them.
    for (var i = 0; i < ball.length; i++){
        ball[i].move();
        ball[i].display();
    }
}

function removeBallsThatHaveSlippedOutOfView(){
    var ballsToKeep = [];
    for (var i = 0; i < ball.length; i++){
        if (ball[i].x + ball[i].breadth > 0) {
            ballsToKeep.push(ball[i]);
        }
    }
    ball = ballsToKeep; // remember the surviving buildings
}

function addNewBallWithSomeRandomProbability() {
    // With a very tiny probability, add a new ball cactus to the end.
    var newBallLikelihood = 0.02; 
    if (random(0,1) < newBallLikelihood) {
        ball.push(makeBall(width));
    }
}

// method to update position of ball shaped cactus every frame
function ballMove() {
    this.x += this.speed;
}


// displays ball-shaped cacti
function ballDisplay(){
    push();
    noStroke();
    fill(this.color);
    ellipse(this.x, this.ey, this.ew, this.eh); // main ball cactus
    fill(204, 209, 135, 60)
    ellipse(this.x, this.ey, this.ew-5, this.eh-5); // highlight
    fill(this.color);
    ellipse(this.x, this.ey, this.ew-10, this.eh-10);
    fill(251, 203, 188);
    stroke(this.color);
    strokeWeight(1);
    ellipse(this.x, this.ey-(this.eh/2), 8, 5) // lil flower guy on top
    pop();
}

// makes ball-shaped cacti
function makeBall(birthLocationX) {
    var b = {x: birthLocationX,
                breadth: 50,
                speed: -4.5,
                eh: random(20, 40), // height of ellipse
                ey: random(200, 225), // y coord of ellipse
                ew: random(20, 40), // width of ellipse
                color: color(random(50, 150), 100, random(100, 200)), // varies shades of blue
                move: ballMove,
                display: ballDisplay}
    return b;
}






Project – 11

I chose to do my project in this minimalist style because I thought it was really cute and reminded me of 8-bit video games (minus all the triangles.) My focus was on the smoothness and cleanliness of the moving image by coordinating objects together.

sketch
var count = 0;

var divwidth = 16;
var divider1;
var divider2;

var bench1;
var bench2;
var bench3;

var people = [];   //holds the people
var mountains = [];  //holds the mountains :)
var trees = [];   //holds the trees 😊

var trainbasecolor = 150;

var windowTop = 30;  //just helper variables for the window dimensions
var windowBottom = 150;


function setup() {
    createCanvas(480, 250);

    for (var i = 0; i < width/15+10; i++){
        mountains[i] = makeMountain(i*15);
    }
    bench1 = makeBench(158);
    bench2 = makeBench(458);
    bench3 = makeBench(-142);
    
    for (var i = 0; i < 6; i++){  //start off w some people
        if (random(0, 30)<13){
				people.push(makePerson(bench1.x-108.5 + i*43.1));
			}
    }
    for (var i = 0; i < 6; i++){  //start off w some people
        if (random(0, 30)<13){
				people.push(makePerson(bench2.x-108.5 + i*43.1));
			}
    }
    for (var i = 0; i < 6; i++){  //start off w some people
        if (random(0, 30)<13){
				people.push(makePerson(bench3.x-108.5 + i*43.1));
			}
    }
    
    divider1 = makeDivider(300);
    divider2 = makeDivider(0);

    
    
    

    
    frameRate(24);



}


function draw() {

	background(150, 180, 255);
	
	noStroke();  
	for(i=0; i<mountains.length; i++){ //draw mountains
		mountains[i].drawit();
	}
	for(i=0; i<trees.length; i++){ //draw trees
		trees[i].drawit();
	}

	fill(trainbasecolor);
	rect(0, windowBottom, width, 125);  //trainbase
	rect(0, 0, width, windowTop);
	fill(120);
	rect(0, height-20, width, 20);

	divider1.drawit();
	divider2.drawit();

	bench1.drawit();
	bench2.drawit();
	bench3.drawit();


	for(i=0; i<people.length; i++){ //draw people
		people[i].drawit();
	}
	




	divider1.stepit();
	divider2.stepit();

	bench1.stepit();
	bench2.stepit();
	bench3.stepit();

	for(i=0; i<people.length; i++){
		people[i].stepit();
	}
	for(i=0; i<mountains.length; i++){
		mountains[i].stepit();
	}
	for(i=0; i<trees.length; i++){
		trees[i].stepit();
	}

	removePeopleThatHaveSlippedOutOfView();
	removeMountainsThatHaveSlippedOutOfView();

	if(count % 15 == 0){       //make mountain objects
		//if(random(0,10)<3){

			mountains.push(makeMountain(680));
			
		//}
	}
	if(count % 30 == 0){      //make tree objects
		if(random(0,10)<6){

			trees.push(makeTree(600));
			
		}
	}




	count ++;
	print(people.length.toString());
}

//FUNCTIONS FOR TREE OBJECTS
function makeTree(tx){
	
	var treeTopWidth = random(100, 150);
	var treeTopHeight = random(50, 100)
	var treeHeight = random(70, 250);
	var trunkWidth = random(10, 50);
	

	var tree = {x: tx, y: 150, c: color(random(25, 75), random(125,175), random(25, 75)), topw: treeTopWidth, trunkw: trunkWidth, toph: treeTopHeight, trunkh: treeHeight, drawit: treeDraw, stepit: treeStep};

	return tree;

}

function treeDraw(){
	fill(150, 100, 50);
	rectMode(CENTER);
	rect(this.x, this.y, this.trunkw, this.trunkh);

	fill(this.c);
	ellipse(this.x, this.y-this.trunkh/2, this.topw, this.toph);
	rectMode(CORNER);

	
}

function treeStep(){
	this.x -= 8;
}

function removeMountainsThatHaveSlippedOutOfView(){

    var treesToKeep = [];
    for (var i = 0; i < trees.length; i++){
        if (trees[i].x > -200) {
            treesToKeep.push(trees[i]);
        }
    }
    mountains = mountainsToKeep; // remember the surviving buildings
}
//FUNCTIONS FOR MOUNTAIN OBJECTS
function makeMountain(mx){
	
	var mountainWidth = random(50, 200);
	var mountainHeight = random(50, 125);
	

	var mountain = {x: mx, y: mountainHeight, w: mountainWidth, c: color(random(80, 120), random(225, 255), random(80, 120)), drawit: mountainDraw, stepit: mountainStep};

	return mountain;

}

function mountainDraw(){
	fill(this.c);
	
	triangle(this.x, this.y, this.x-this.w, 250, this.x+this.w, 250);
	
}

function mountainStep(){
	this.x -= 2;
}

function removeMountainsThatHaveSlippedOutOfView(){

    var mountainsToKeep = [];
    for (var i = 0; i < mountains.length; i++){
        if (mountains[i].x > -200) {
            mountainsToKeep.push(mountains[i]);
        }
    }
    mountains = mountainsToKeep; // remember the surviving buildings
}


//FUNCTIONS FOR WINDOW DIVIDER OBJECTS
function makeDivider(wx) { 
    var divider = {x: wx, y: windowTop,
                  drawit: dividerDraw, stepit: dividerStep};

    return divider;
}

function dividerDraw(){
	fill(trainbasecolor);
	rect(this.x, this.y, divwidth, 150);
}

function dividerStep(){
	this.x++;
	
	if(this.x == 600-divwidth){
		this.x = (0-divwidth);
		
	}

	

}
//FUNCTIONS FOR PEOPLE OBJECTS
function makePerson(px){
	
	var personWidth = random(15, 35);
	var personHeight = random(25, 60);
	var headSize = random(8, 20);

	var person = {x: px, y: 196-personHeight/2, w: personWidth, h: personHeight, hs: headSize, c: random(0, 50), drawit: personDraw, stepit: personStep};

	return person;

}

function personDraw(){
	fill(this.c);
	rectMode(CENTER);
	rect(this.x, this.y, this.w, this.h);
	rect(this.x-this.w/4, 212, 5, 36);
	rect(this.x+this.w/4, 212, 5, 36);
	rect(this.x, this.y-this.h/2-this.hs/2+1, this.hs, this.hs);
	rectMode(CORNER);
	
}

function personStep(){
	this.x++;
}

function removePeopleThatHaveSlippedOutOfView(){

    var peopleToKeep = [];
    for (var i = 0; i < people.length; i++){
        if (people[i].x < 600) {
            peopleToKeep.push(people[i]);
        }
    }
    people = peopleToKeep; // remember the surviving buildings
}

//FUNCTIONS FOR BENCH OBJECTS
function makeBench(bx){
	var bench = {x: bx, y: 170+divwidth, drawit: benchDraw, stepit: benchStep};
	return bench;

	
}



function benchDraw(){
	rectMode(CENTER);
	fill(220);

	rect(this.x, this.y, 266, 50);
	
	for(i=0; i<6; i++){
		fill(225, 0, 0);
		rect(this.x-108 + i*43.1, this.y, 38, 40);
		fill(155, 0, 0);
		rect(this.x-108 + i*43.1, this.y+15, 38, 10);
		
	}
	rectMode(CORNER);

}

function benchStep(){
	this.x++;
	if(this.x == 750){
		this.x = -150;
		for(i=0; i<6; i++){
			if (random(0, 30)<13){
				people.push(makePerson(this.x-108.5 + i*43.1));
			}
		
		}
	}

}

LO – 11

The artist I looked at this week was LIA, an Australian multidisciplinary artist who has been producing work since 1995. Many of the works she creates are generative, kinetic images created computationally. She works with themes of ephemerality and randomness, and is interested in exploring the fleeting nature of beauty in her work by creating pieces that are always moving and never repeat themselves.

One of the pieces I looked at was Winter, part of a series LIA did about the seasons. I liked this piece because it represents the slow falling of snow in a beautifully abstract way. I also think that it plays in really well with her theme of change and randomness, expressing nature through coding in a cool way.

Project 11: Deep Sea

For the project this week, I wanted to create a scene that depicts marine life, with fish seaweed and bubbles blown by the wish.

The objects in this scene are of three types:

  1. Stable – pebbles, seabed
  2. Movement – seaweed, which moves between constraints for the effect of swaying in water
  3. Motion – the fish and the bubbles.

I planned the scene in a sketch and then, using the starter code, tried to explore different ways of making the scene dynamic.

For the fish, I first, used the constructor, to make the shape of the fish and then used transparency to create an element of uniqueness in each new fish that is born on the canvas. This also enhances the effect of transparency scales and that eveything under water is bobbing and swaying.

For the motion of the seaweed, I used the random() function so that the height of the rectangle moves between two constraints, this giving the movement effect.

Please view the full code and visual preview here:

https://editor.p5js.org/ssahasra/full/R7Sh-om9z

Project 11 – Landscape

sketchDownload
//Ian Lippincott
//ilippinc@andrew.cmu.edu
//Section: D
//Project 11

var hill = [];
var mountains = [];
var trees = [];
var c1;
var c2;
var noiseParam = 0;
var noiseStep = 0.03;

function setup() {
    createCanvas(400, 240);
    //Define background colors
    c1 = color(228, 90, 41);
    c2 = color(221, 197, 75);
    strokeWeight(1);
    frameRate(20);
    for (var i = 0; i < (width / 5) + 1; i++) {
      var n = noise(noiseParam);
      var value = map(n, 0, 1, 50, 200);
      hill.push(value);
      noiseParam += noiseStep;
    }
}

 // create an initial collection of mountains 
    for (var i = 0; i < 10; i++){
        var rx = random(width);
        mountains[i] = makemountain(rx);
    }

// create an initial collection of trees 
    for (var i = 0; i < 10; i++){
        var r = random(width);
        trees[i] = maketree(r);
    }    

function draw() {
  setGradient(c1, c2);
  strokeJoin(BEVEL);
  stroke(0);
  strokeWeight(4);
  fill(63, 77, 44);
  hill.shift(); 
  var n = noise(noiseParam);
  var value = map(n, 0, 1, 50, 150);
    hill.push(value);
    noiseParam += noiseStep;
    beginShape();
    vertex(0, height);
    for (var i = 0; i < (width / 5) + 1; i++) {
      vertex(i * 5, hill[i]);
    } 
    vertex(width, height);
    endShape();

    //Ground
    fill(95, 110, 73);
    rect(0, 199, width, height);

    //mountains
    updateAndDisplayMountains();
    removeMountainsThatHaveSlippedOutOfView();
    addNewMountainsWithSomeRandomProbability();

    //Trees
    updateAndDisplayTrees();
    removeTreesThatHaveSlippedOutOfView();
    addNewTreesWithSomeRandomProbability();
}

//mountains
function makeMountain(birthLocationX) {
    var mntn = {x: birthLocationX,
                breadth: 70,
                speed: -5.5,
                nFloors: round(random(2,8)),
                move: mountainMove,
                display: mountainDisplay}
    return mntn;
}

// method to update position of mountain every frame
function mountainMove() {
    this.x += this.speed;
}

// draw the mountain
function mountainDisplay() {
    var floorHeight = 8;
    var cHeight = this.nFloors * floorHeight; 
    
    strokeWeight(4);
    stroke(0);
    fill(156, 119, 76);
    push();
    translate(this.x, height - 40);

    //Mountain
    triangle(-7,0,this.breadth/2,-cHeight-20,this.breadth + 7,0);
    //Shadow
    fill(87, 66, 42);
    triangle(-7,0,this.breadth/2,-cHeight-20,20,0);
    //Snow
    pop();
}

function updateAndDisplayMountains(){
    // Update the mountain's positions, and display them.
    for (var i = 0; i < mountains.length; i++){
        mountains[i].move();
        mountains[i].display();
    }
}

function removeMountainsThatHaveSlippedOutOfView(){
  var mountainToKeep = [];
  for (var i = 0; i < mountains.length; i++){
    if (mountains[i].x + mountains[i].breadth > 0) {
        mountainToKeep.push(mountains[i]);
    }
  }
  mountains = mountainToKeep; // remember the surviving mountain
}

function addNewMountainsWithSomeRandomProbability() {
    // With a very tiny probability, add a new cabin to the end.
    var newMountainLikelihood = 0.02; 
    if (random(0,1) < newMountainLikelihood) {
        mountains.push(makeMountain(width));
    }
}


//trees
function makeTree(birthLocationX) {
    var tr = {x: birthLocationX,
                breadth: 70,
                speed: -6.0,
                nFloors: round(random(2,8)),
                move: treeMove,
                display: treeDisplay}
    return tr;
}

// method to update position of tree every frame
function treeMove() {
    this.x += this.speed;
}

// draw the tree
function treeDisplay() {
    var floorHeight = 8;
    var cHeight = this.nFloors * floorHeight; 
    
    strokeWeight(4);
    stroke(0);
    fill(71, 145, 80);
    push();
    translate(this.x, height - 40);

    //Tree
    triangle(0, 0, 10,-cHeight, 20, 0);
    triangle(0, -8, 10,-cHeight, 20, -8);
    triangle(0, -16, 10,-cHeight, 20, -16);
    pop();
}

function updateAndDisplayTrees(){
    // Update the tree's positions, and display them.
    for (var i = 0; i < trees.length; i++){
        trees[i].move();
        trees[i].display();
    }
}

function removeTreesThatHaveSlippedOutOfView(){
  var treeToKeep = [];
  for (var i = 0; i < trees.length; i++){
    if (trees[i].x + trees[i].breadth > 0) {
        treeToKeep.push(trees[i]);
    }
  }
  trees = treeToKeep; // remember the surviving mountain
}

function addNewTreesWithSomeRandomProbability() {
    // With a very tiny probability, add a new cabin to the end.
    var newTreeLikelihood = 0.08; 
    if (random(0,1) < newTreeLikelihood) {
        trees.push(makeTree(width));
    }
}

//Makes Gradient Background
function setGradient(c1, c2) {
  noFill();
  for (var b = 0; b < height; b++) {
    var inter = map(b, 0, height, 0, 1);
    var c = lerpColor(c1, c2, inter);
    stroke(c);
    line(0, b, width, b);
  }
}

LO-11 : Tega Brain

Keeping Time: a time visualisation with photos

Of all the women practitioners I have come across in the field of interaction design and computation, I find Tega Brain’s voice to be one of the most unique. Tega Brain uses computation and combines it with environmental interpretation of computers and her work forms bridges between computation and design as it occurs in nature. She creates computation systems/projects that respond to natural phenomena and vice versa. 

Tega Brain is an Australian-born computational designer/artist. She has a background in environmental engineering. She is a professor of New Media at NYU and is associated with Processing.org – a language similar to p5.js for visual computation.

The project I found the most interesting, especially because we recently learnt about images in p5.js is called “Keeping Time”. As described on her website – “Keeping Time portrays a complex biological system living through the Anthropocene. The series is made by scraping the Flickr database for images of particular plant species and laying the results out according to their time stamp. Photographs for each year are arranged in rows and are ordered across each row according to date.”

She uses transparency of images and their density in a given area of pixels to visualise time and the age of species. I admire that she uses images to visualise data and this project speaks to her larger body of work where she combines design with environmental phenomena.

LO 11 – A Focus on Women Practitioners

Madeline Gannon is a designer of interactive tools for digital fabrication at Madlab. The project I am highlighting is called Tactum, which is an augmented modeling tool that is used to design 3D printed wearables. This tool uses depth-sensing and projection mapping to sense different inputs and in turn, project touch gestures on the user’s skin. This is a very ingenious method of rapid prototyping that allows anybody to design a 3D printed wearable, and see real-time feedback throughout the process. It is very interesting to see the limitations of a program with a finite amount of possible creations (due to the given size and number of bands). I would really like to explore this tool and discover new methods of interaction and how they would produce different outcomes.

http://www.madlab.cc/tactum

Project 11 – Generative Landscape

My project is a simple landscape with hills, trees, buildings, birds, and the sun. The trees vary in size and location, the building varies in width, and the birds vary in location and speed.

Maggie – Generative Landscape
//Maggie Ma
//Section D
//Generative Landscape

var buildings = [];
var hills = [];
var noiseParam = 0;
var noiseStep = 0.02;
var trees = [];
var birds = [];


function setup() {
    createCanvas(400, 500); 
    strokeWeight(4);
    
    // create an initial collection of buildings
    for (var i = 0; i < 2; i++){
        var rx = random(width);
        buildings[i] = makeBuilding(rx);
    }
    //create an initial collection of birds
    for (var i = 0; i < 3; i++){
        var rx = random(width);
        birds[i] = makeBird(rx);
    }

    // drawing hills in the back
    for (var i = 0; i<width/5 +1; i++) {
    	var n = noise(noiseParam);
    	var value = map(n,0,1,0,height+50);
    	hills.push(value);
    	noiseParam+=noiseStep;
    }
    frameRate(15);
}


function draw() {
    background(255,203,186); //light pink

    //sun
    fill(253,165,0); //yellow
    circle(width/2, height/2-70, 120.438 );

    //birds
    updateandDisplayBird();
    removeBirdThatHaveSlippedOutOfView();
    addNewBirdWithSomeRandomProbability();	

    //hills
    drawHills();
    displayHorizon();

    //building
    updateAndDisplayBuilding();
    removeBuildingsThatHaveSlippedOutOfView();
    addNewBuildingsWithSomeRandomProbability(); 

   //trees
    updateAndDisplayTrees();
    removeTreesThatHaveSlippedOutOfView();
    addNewTreesWithSomeRandomProbability(); 
}

function drawHills() {
	hills.shift();
    var n = noise(noiseParam);
    var value = map(n,0,1,0,height+50);
    hills.push(value);
    noiseParam += noiseStep;

    beginShape();
    vertex(0,height);
    for(var i =0; i <= width/5; i++) {
    	fill(255,163,130); //pink color
    	strokeWeight(4);
    	vertex((i*5),hills[i]);
    
    }
    vertex(width,height);
    endShape();
}

//creating trees
function makeTree(birthLocationX) {
    var t = {x: birthLocationX,
                breadth: round(random(10,30)),
                speed: -5.0,
                y: random(10, 40), //randomize tree size and location
                w: random(30, 40),
                h: random(40, 60),
                move: treeMove,
                display: treeDisplay}
    return t;
}

function treeMove() {
    this.x += this.speed;
}

function treeDisplay() {
    push();
    translate(this.x, height -125);
    strokeWeight(4); 
    fill(80,202,119);
    //leaves
  	ellipse(this.x,this.y, this.w, this.h);
  	//trunk
  	line(this.x, this.y+10, this.x, this.y+70);
    pop();
}

function updateAndDisplayTrees(){
    for (var i = 0; i < trees.length; i++){
        trees[i].move();
        trees[i].display();
    }
}

function removeTreesThatHaveSlippedOutOfView(){
    var treesToKeep = [];
    for (var i = 0; i < trees.length; i++){
        if (trees[i].x + trees[i].breadth > 0) {
            treesToKeep.push(trees[i]);
        }
    }
    trees = treesToKeep;
}
function addNewTreesWithSomeRandomProbability() {
    var newTreeLikelihood = 0.07; 
    if (random(0,1) < newTreeLikelihood) {
        trees.push(makeTree(width));
    }
}

//creating building
function makeBuilding(birthLocationX) {
    var bldg = {x: birthLocationX,
                breadth: 70,
                speed: -8.0,
                w: random(70,110), //randomize width
                move: buildingMove,
                display: buildingDisplay}
    return bldg;
}

function buildingMove() {
    this.x += this.speed;
}

function buildingDisplay() {
	push();
    strokeWeight(4); 
    fill(253,165,0); //yellow block on right side
  	rect(this.x ,315.478 ,this.w ,137.574);
  
  	rect(this.x - 55.901, 364.514 ,15.016 ,88.538); //yellow pillars
  	rect(this.x +7.51, 364.514 ,15.016 ,88.538);
  	rect(this.x-28.083,180.775,23.237,26.131); //yellow top
  	fill(255,255,255);
  	rect(this.x-33.153,206.996,33.377,33.377); //middle section
  	fill(253,165,0);
  	rect(this.x-21.845,219.566,10.762,20.807);
  	fill(255,255,255);
  	rect(this.x-40.661, 240.463,48.108 ,212.59 ); //bottom base
  	fill(0,195,227);
  	rect(this.x-40.661,259.105,15.016 ,25.094); //turquoise designs
  	rect(this.x-40.661,302.931,15.016 ,25.094);
  	rect(this.x-7.508,259.105,15.016 ,25.094 );
  	rect(this.x-7.508, 302.931,15.016 ,25.094);
  	fill(225,43,0);
  	rect(this.x-40.885,346.758,15.016,106.295); //red designs
  	rect(this.x-7.508,346.758,15.016,106.295);
  	line(this.x-25.869,240.8 ,this.x-25.869,453.053);
  	line(this.x-7.508,240.8 ,this.x-7.508,453.053);

    pop();
}

function updateAndDisplayBuilding(){
    for (var i = 0; i < buildings.length; i++){
        buildings[i].move();
        buildings[i].display();
    }
}

function removeBuildingsThatHaveSlippedOutOfView(){
    var buildingToKeep = [];
    for (var i = 0; i < buildings.length; i++){
        if (buildings[i].x + buildings[i].breadth > 0) {
            buildingToKeep.push(buildings[i]);
        }
    }
    buildings = buildingToKeep;
}
function addNewBuildingsWithSomeRandomProbability() {
    var newBuildingLikelihood = 0.015; 
    if (random(0,1) < newBuildingLikelihood) {
        buildings.push(makeBuilding(width));
    }
}

//creating birds
function updateandDisplayBird(){
    for (var i = 0; i < birds.length; i ++){
        birds[i].move();
        birds[i].display();
    }
}

function removeBirdThatHaveSlippedOutOfView(){
    var keepBirds=[];
    for (var i = 0; i < birds.length; i++) {
        if (birds[i].x < width) {
            keepBirds.push(birds[i]);
        }
    }
    birds = keepBirds;
}

function addNewBirdWithSomeRandomProbability(){
    var newBirdLikelihood = 0.01; 
    if (random(0,1) < newBirdLikelihood) {
        birds.push(makeBird(15, 15));
    }
}

function Birdmove(){
    this.x += this.speed;
}

function birdDisplay(){
    fill(0);
    stroke(0);
    push();
    translate(this.x, this.y);
    //wings
    triangle(0, 0, 3, 0, -2, -3);
    triangle(0, 0, 3, 0, 2, 3);
    pop();
}

function makeBird(birthLocationX, birthLocationY){
    var bird = {x: birthLocationX,
                y:random(100,200),
                speed:random(2, 9),
                move: Birdmove,
                display: birdDisplay};
    return bird;
}
//creating grass horizon line
function displayHorizon(){
    fill(106,207,124);
    stroke(4);
    rect(0, height-50, width, height-50);
}

LO 11 – A Focus on Women Practitioners

Claudia Hart

The Dolls House (2016)

For my female artist I chose to learn about Claudia Hart, a computational fine artist of interactive imagery. Her work features topics such as issues of the body, perception, the real vs. unreal, and the relationship between nature and technology. Hart’s work is “symbolist and poetic” (from her website bio), and can be described as mesmerizing and hypnotic. She describes her work as “post photography” —her pieces are generated from computer models instead of captured with a camera. 

I examined her piece The Dolls House—a special series of video, drawing and sculpture inspired by the media ballet The Dolls, based in the philosophical idea that history forever renews itself through “a process of decadence, decay and rebirth” (https://claudiahart.com/The-Dolls-House-2016). In this piece, Hart molded mathematical cycles into visual form: a figurative flicker film created with rhythmic animations and pulsing patterns. The passage of time is defined by a cyclical animation where a light moves around the virtual set, casting shadows to mimic sunrise and sunset. 

Project 11: Landscape

sketch
 /*
 Bon Bhakdibhumi
 bbhakdib
 Section D
 */
var backgroundX = 355;
var foregroundX = 250;
function preload() {
    train = loadImage("https://i.imgur.com/cMqi4AV.png");
    house = loadImage("https://i.imgur.com/KrNQaN2.png");
    tower = loadImage("https://i.imgur.com/P6WEAeL.png");
    montain = loadImage("https://i.imgur.com/04duSGs.png");
    backgroundHouse = loadImage("https://i.imgur.com/DgMNstF.png");
    backgroundTower = loadImage("https://i.imgur.com/AuMqECF.png");
}

 function setup() {
    createCanvas(480, 240);
 }

 function draw() {
// backdrop
    noStroke();
    fill(147, 129, 101);
    rect(0, 175, 480, 65);
    fill(164, 233, 244);
    rect(0, 0, 480, 174);
    imageMode(CENTER);
// background elements
    for (var i = 0; i < 3; i ++) {
        image(backgroundTower, backgroundX - (i * 200), 117, 200, 200);
        image(backgroundHouse, (backgroundX + 80) - (i * 200), 147, 200, 200);
    }
// foreground elements
    image(montain, foregroundX, 105, 250, 250);
    image(house, foregroundX - 140, 137, 210, 210);
    image(tower, foregroundX + 130, 105.5, 210, 210);
    image(train, 240, 120, 480, 240);
    backgroundX -= 2; 
    foregroundX -= 2;
// resetting foreground and background elements
    if (backgroundX <= -125) {
        backgroundX = 900;
    }

    if (foregroundX <= -150) {
        foregroundX = 825
    }
}

For this project, I chose to make a landscape of a town I visited by train for the first time.