Looking Outwards 11- Simin Li

collinstorino
Nicolas Collins In Memoriam Michel Waisvisz in Italy, March 20, 2013 Photo: Stefano Bassanese

In Memoriam Michel Waisvisz was a project done by Nicolas Collins in 2009 to remember the life of Michel Waisvisz who was also a musical composer and inventor of experimental electronic musical instruments. The instrument used in this performance is a simple candle along with a device used to pick up the movement of the flame. The flame controls the oscillators possibly through a temperature sensor.

Candle-controlled oscillators by students of Nicolas Collins in Le quai-Mulhouse Art School
Simple candle-controlled oscillators by students of Nicolas Collins in Le quai-Mulhouse Art School

The way the artist’s artistic abilities are manifested in this project is through his movement of the detector. As the detector moves further or closer to the flame the music changes in pitch and volume. He moves the detector as though it is the baton of a conductor. Another way might be that the artist tuned the device to make it produce the best sounds possible. At the beginning of the performance I did not feel like it was very interesting. However, as the candle started burning out, the flame started flickering which caused the music to be somewhat chaotic. The flickering of the candle and the change in music reminded me of a person struggling for life, refusing to die out and gasping for breath. After a while, the flame dies out as all flames do. All light is gone and the only thing you can hear is silence. The use of a candle in this instrument is very suitable for the artist’s intensions.

Links:

Nicolas Collins Website

Nicolas Collins: Live At Café Oto February 2010

Feedback Examples: Nicolas Collins

In Memoriam Michel Waisvisz by Nicolas Collins on Youtube

 

GarrettRauck-Project-10

sketch

//Garrett Rauck
//Section C
//grauck@andrew.cmu.edu
//Assignment-07a-Bar Chart

/////////////////////////////////
// INIT VARIABLES
/////////////////////////////////
//canvas vars
var canvasWidth, canvasHeight;
//artwork vars
var horizon;
var landscapes = []; //array to store landscape objects
//cactus vars
var minCactusSize, maxCactusSize;
var minCactusSpeed, maxCactusSpeed;
var minCactusY, maxCactusY;
var cacti = []; //array to store cactus objects
//colors
var cactusFill, cactusStroke;
var skyColor, skyColor1, skyColor2, skyFaderVal, skyFaderSpeed;

/////////////////////////////////
// HELPER FNS
/////////////////////////////////
function drawMovingLandscape() {
	//draw backdrop
	for (var i=0; i<landscapes.length; i++) landscapes[i].draw();
	//draw cacti
    for (var j=0; j<cacti.length; j++) cacti[j].draw();
}

function moveCacti() {
	//move each cactus in stored list of cacti
	for (var i=0; i<cacti.length; i++) cacti[i].move();
}

function removeCactiOutOfView() {
	var cactiToKeep = [];
	for (var i=0; i<cacti.length; i++) {
		if (cacti[i].x + cacti[i].size/2 > 0) {
			cactiToKeep.push(cacti[i]);
		}
	}
	cacti = cactiToKeep;
}

// function adapted from Stack Overflow thread
// http://stackoverflow.com/questions/12788051/
// how-to-sort-an-associative-array-by-value
function sortArray(a) {
	a.sort(function(a,b) {
		return a.y - b.y;
	})
}

function updateSkyColor() {
	//update sky fader val
	skyFaderVal = ((millis()*skyFaderSpeed)%1000)/1000;
	if (Math.floor(millis()/1000*skyFaderSpeed)%2 == 0) {
		skyColor = lerpColor(skyColor1, skyColor2, skyFaderVal);
	}
	else {
		skyColor = lerpColor(skyColor2, skyColor1, skyFaderVal);
	}
}

/////////////////////////////////
// LANDSCAPE CLASS
/////////////////////////////////
function makeLandscape(inCY, inRange, inSpeed, inDetail, inColor, inStroke) {
	landscape = {cy: inCY,
		 range: inRange,
		 speed: inSpeed,
		 detail: inDetail,
		 c: inColor,
		 s: inStroke,
		 draw: drawLandscape
	     }
	landscapes.push(landscape);
}

function drawLandscape() {
	// Landscape generator adapted from code provided by 15-104 staff

	fill(this.c);
	stroke(this.s)
	beginShape();
	vertex(0,canvasHeight);
	for (var x=0; x<canvasWidth; x++) {
		var t = (x*this.detail) + (millis()*this.speed);
        var y = map(noise(t), 0, 1, this.cy-this.range/2, this.cy+this.range/2);
        vertex(x,y);
	}
	vertex(canvasWidth, canvasHeight);
	endShape(CLOSE);
}

/////////////////////////////////
// CACTUS CLASS
/////////////////////////////////
function makeCactus(scale) {
	//get properties
	inSize = map(scale, 0, 1, maxCactusSize, minCactusSize);
	inX = canvasWidth + 100 + inSize;
	inY = map(scale, 0, 1, maxCactusY, minCactusY);
	inSpeed = map(scale, 0, 1, maxCactusSpeed, minCactusSpeed);
	//create cactus instance
	cactus = {x: inX,
	          y: inY,
	          size: inSize,
	          speed: inSpeed,
	          draw: drawCactus,
	          move: moveCactus
	    }
	//store new cactus in cacti array
	cacti.push(cactus);
}

function moveCactus() {
	this.x -= this.speed;
}

function drawCactus() {
	//set drawing properties
	// fill(-1);
	stroke(cactusStroke);
	//draw trunk
	beginShape();
	vertex(
		this.x-this.size*0.1,
		this.y);
	vertex(
		this.x-this.size*0.1,
		this.y-this.size*0.5);
	vertex(
		this.x-this.size*0.4,
		this.y-this.size*0.5);
	vertex(
		this.x-this.size*0.4,
		this.y-this.size*0.8);
	vertex(
		this.x-this.size*0.25,
		this.y-this.size*0.8);
	vertex(
		this.x-this.size*0.25,
		this.y-this.size*0.65);
	vertex(
		this.x-this.size*0.1,
		this.y-this.size*0.65);
	vertex(
		this.x-this.size*0.1,
		this.y-this.size*1.0);
	vertex(
		this.x+this.size*0.1,
		this.y-this.size*1.0);
	vertex(
		this.x+this.size*0.1,
		this.y-this.size*0.5);
	vertex(
		this.x+this.size*0.2,
		this.y-this.size*0.5);
	vertex(
		this.x+this.size*0.2,
		this.y-this.size*0.75);
	vertex(
		this.x+this.size*0.35,
		this.y-this.size*0.75);
	vertex(
		this.x+this.size*0.35,
		this.y-this.size*0.35);
	vertex(
		this.x+this.size*0.1,
		this.y-this.size*0.35);
	vertex(
		this.x+this.size*0.1,
		this.y);
	endShape(CLOSE);
}

/////////////////////////////////
// EVENTS
/////////////////////////////////

/////////////////////////////////
// RUN!
/////////////////////////////////
function setup() {
	// INIT VARS
	//canvas
	canvasWidth = 600;
	canvasHeight = 400;
	//artwork
	horizon = 250;
	//cactus vars
	minCactusSize = 5;
	maxCactusSize = 100;
	minCactusSpeed = 1;
	maxCactusSpeed = 4;
	minCactusY = horizon+5;
	maxCactusY = canvasHeight+10;
	//colors
	cactusStroke = 255;
	skyColor1 = color(218, 165, 32);
	skyColor2 = color(72, 61, 139);
	skyColor = skyColor1;
	skyFaderVal = 0;
	skyFaderSpeed = .1;

	// CANVAS SETUP
    createCanvas(canvasWidth, canvasHeight);

    //INIT OBJECTS
    //far mountains
    makeLandscape(50, 100, 0.0001, .01, color(0), color(255));
    //close mountains
    makeLandscape(125, 75, 0.0002, .009, color(0), color(255));
    //ground
    makeLandscape(horizon, 10, 0.0003, .005, color(0), color(255));
    //test cactus
    makeCactus(random(0,canvasHeight-horizon));
}

function draw() {
	background(skyColor); //update background

	//UPDATE MODEL
	// new cactus 2% of the time
	if (random(0,1) < 0.02) {
		//new cactus with random distance from bottom of canvas
		makeCactus(random(0,1));
	}
	//move cacti
	moveCacti();
	//remove
	removeCactiOutOfView();
	//sort cacti by distance from view
	sortArray(cacti);
	//update sky color
	updateSkyColor();

	//DRAW THE LANDSCAPE
	drawMovingLandscape();
}

Looking Outwards 11 sajohnso

 

The Counter Pointer Overview,

credit to thecounterpointer.com

 

http://www.luisaph.com/info.html

Luisa Perira is an artist and programmer who is based in New York and has worked for companies like Samsung and Google. I admire her, however, for her work on a number of audiovisual systems and machines, such as “The Well-Tempered Synthesizer”- a Moog analog synthesizer which was programmed to play a number of classical pieces from the Baroque period, as well as the electronic sounds that it is known for. I admire both her passion for mixing the cutting-edge and the obsolete and that she has found a way to pursue her interests in music, design and computer science. She has been featured in Wired, Gizmoto and Creative applications, and is currently displaying her work in Brazil.

 

“The Well-Sequenced-Synthesizer”, Luisa Perira, 2014

http://www.thewellsequencedsynthesizer.com/

 

sajohnso-project-10

landscape

/*
*Sadie Johnson
*15-104 Section C
*sajohnso@andrew.cmu.edu
*Project-10
*/

//setting up arrays
var moons = [];
var clouds = [];
var planets = [];
var c1, c2; //setting up colors for gradient


function setup() {
    createCanvas(600, 240); 
    frameRate(10);

    //sets up the two colors in the gradient background
    c1 = color('#221A25'); //black on top
    c2 = color('#3B2A3A'); //dark purple on bottom

    // create initial moons
    for (var i = 0; i < 2; i++){ //changng limit of loop affects # of moons initially on screen
        var rx = random(width);
        moons[i] = makeMoon(rx);
    }

    // create initial clouds
   for (var c = 0; c < 8; c++){ //affects # of planets initially on screen
        var cl = random(width);
        clouds[c] = makeCloud(cl);
    }

    // create initial clouds
    for (var p = 0; p < 5; p++){ //affects # of planets initially on screen
        var pl = random(width);
        planets[p] = makePlanet(pl);
    }

}


function draw() {

    //purple-black gradient in backgorund
    for (var i = -00; i <= height-50; i++) {
        var inter = map(i, 90, 170, 0, 1);
        var c = lerpColor(c1, c2, inter);
        stroke(c);
        line(0, i, width, i);
    }

    //OCEAN
    drawOcean();
    
    //MOONS
    updateAndDisplayMoons();
    removeMoonsThatHaveSlippedOutOfView();
    addNewMoonsWithSomeRandomProbability(); 

    //PLANETS
    updateAndDisplayPlanets();
    removePlanetsThatHaveSlippedOutOfView();
    addNewPlanetsWithSomeRandomProbability();
   
    //CLOUDS
    updateAndDisplayClouds();
    removeCloudsThatHaveSlippedOutOfView();
    addNewCloudsWithSomeRandomProbability();
    



}


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

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

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


function removeMoonsThatHaveSlippedOutOfView(){
    var moonsToKeep = [];
    for (var i = 0; i < moons.length; i++){
        if (moons[i].x + moons[i].breadth > 0) {
            moonsToKeep.push(moons[i]);
        }
    }
    moons = moonsToKeep; // remember the surviving moons
}

function removeCloudsThatHaveSlippedOutOfView(){
    var cloudsToKeep = [];
    for (var i = 0; i < clouds.length; i++){
        if (clouds[i].x + clouds[i].breadth > 0) {
            cloudsToKeep.push(clouds[i]);
        }
    }
    clouds = cloudsToKeep; // remember the surviving clouds
}

function removePlanetsThatHaveSlippedOutOfView(){
    var planetsToKeep = [];
    for (var i = 0; i < planets.length; i++){
        if (planets[i].x + planets[i].breadth > 0) {
            planetsToKeep.push(planets[i]);
        }
    }
    planets = planetsToKeep; // remember the surviving planets
}


function addNewMoonsWithSomeRandomProbability() {
    // Spawn a new moon to the right edge of the canvas
    var newMoonLikelihood = 0.0004; //moons are VERY unlikely
    if (random(0,1) < newMoonLikelihood) {
        moons.push(makeMoon(width));
    }
}

function addNewCloudsWithSomeRandomProbability() {
    // Spawn a new cloud to the right edge of the canvas
    var newCloudLikelihood = 0.02; //clouds are spawned relatively often
    if (random(0,1) < newCloudLikelihood) {
        clouds.push(makeCloud(width));
    }
}

function addNewPlanetsWithSomeRandomProbability() {
    // Spawn a new cloud to the right edge of the canvas
    var newPlanetLikelihood = 0.002; //moderately likely
    if (random(0,1) < newPlanetLikelihood) {
        planets.push(makePlanet(width));
    }
}


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

// method to update position of cloud every frame
function cloudMove() {
    this.x += this.speed;
}
    
// method to update position of planet every frame
function planetMove() {
    this.x += this.speed;

}


function moonDisplay() {
    var bHeight = this.nFloors * 20;
    //the following variables are used to randomize the size of the 'reflections'
    var rando1 = random(bHeight/2,bHeight/2+10);
    var rando2 = random(bHeight/2,bHeight/2+10);
    var rando3 = random(bHeight/2,bHeight/2+10);

    noStroke();

    push();
    translate(this.x, height - 40);

    //DRAWS THE ECLIPSE EFFECT BEHIND THE MOON
    for (var i=20; i>0; i--){ //the glow is made of 20 overlapping circles
        fill(217,154,100,(10-i)*4);// semi-transparent yellow glow
        ellipse(0, -bHeight-7, bHeight+(10*i), bHeight+(10*i));
    }

    //DRAWS OPAQUE HIGHLIGHT BEHIND MOON
    fill('#FED196'); //opaque, light yellow
    ellipse(0, -bHeight-3, bHeight+2, bHeight+2);

    //DRAWS THE MOON
    fill('#836469'); //light purple
    ellipse(0, -bHeight, bHeight, bHeight);

    //DRAWS MOON REFLECTION ON WATER
    fill(217,154,100,150); //semi-transparent yellow
    ellipse(0, -bHeight*(5/bHeight), rando1/3, bHeight/20);
    ellipse(0, -bHeight*(5/bHeight)+7, rando2/2, bHeight/20);
    ellipse(0, -bHeight*(5/bHeight)+17, rando3, bHeight/10);
    ellipse(0, -bHeight*(5/bHeight)+27, rando2/2, bHeight/20);
    ellipse(0, -bHeight*(5/bHeight)+45, rando1+10, bHeight/5);
    pop();
}


function cloudDisplay() {
    var bHeight = this.nFloors * 20;
    var lowHeight = bHeight+5;

    push();
    translate(this.x, height-110);

    //DRAWS HIGHLIGHT BEHIND CLOUDS
    fill('#563F51'); //light purple
    //slightly larger and higher than the darker clouds
    //however, these clouds (usually) have the same shape
    ellipse(0, -lowHeight+10, this.breadth, lowHeight/2.5);
    ellipse(-10, -lowHeight+8, this.breadth*.8, lowHeight/2.5);
    ellipse(-10, -lowHeight-15, this.breadth*.7, lowHeight/2.5);
    ellipse(25, -lowHeight+5, this.breadth, lowHeight-20);
    ellipse(15, -lowHeight+15, this.breadth*1.2, lowHeight-20);
    ellipse(15, -lowHeight-10, this.breadth*.6, lowHeight-20);

    //DRAWS DARKER, LOWER CLOUDS
    fill('#353040');//darker purple
    //xposition, yposition and size modified by randomly chosen integers
    //in order to make clouds appear randomly generated
    ellipse(0, -bHeight, this.breadth, bHeight-20);
    ellipse(-10, -bHeight+10, this.breadth*.8, bHeight-20);
    ellipse(-10, -bHeight-15, this.breadth*.7, bHeight-20);
    ellipse(25, -bHeight+5, this.breadth, bHeight-20);
    ellipse(15, -bHeight+15, this.breadth*1.2, bHeight-20);
    ellipse(15, -bHeight-10, this.breadth*.6, bHeight-20);
    pop();
}

function planetDisplay() {
    var bHeight = this.nFloors * 20;
    push();
    translate(this.x, height - 40);

    //DRAWS HIGHLIGHT BEHIND PLANET
    fill(217,154,100,150); //light yellow
    ellipse(0, -bHeight-99, bHeight+3, bHeight+3); //slightly larger and lower than planet

    //DRAWS PLANET
    fill('#352831'); //dark purple
    ellipse(0, -bHeight-100, bHeight, bHeight);
    pop();
}





function makeMoon(birthLocationX) {
    var bldg = {x: birthLocationX,
                breadth: 50,
                speed: -.1, //moons travel the slowest
                nFloors: round(random(5,8)), //y positions moons travel along
                move: moonMove,
                display: moonDisplay}
    return bldg;
}

function makeCloud(birthLocationX) {
    var bldg = {x: birthLocationX,
                breadth: 60, //puffiness of clouds
                speed: -1.6, //clouds travel the fastest
                nFloors: round(random(-1,2)), //y positions clouds travel along
                move: cloudMove,
                display: cloudDisplay}
    return bldg;
}

function makePlanet(birthLocationX) {
    var bldg = {x: birthLocationX,
                breadth: 50,
                speed: -.2, //planets travel intermediately fast
                nFloors: round(random(-2,4)), //y positions planets travel along
                move: planetMove,
                display: planetDisplay}
    return bldg;
}


 function drawOcean(){
    noStroke();
    fill('#371D20'); //dark purpleish red
    rect(0,height-50,width, 50);

}

For this project, I wanted to draw a sky with different planets, which would move at different speeds. I didn’t anticipate that planets would look so abstract if they were just circular, so I had to use lighting and shadow to make my objects clearer.

img_6957

AndrewWang-Project-10

sketch

//Andrew Wang

var cars = [];
var count = 0;

function setup(){
    createCanvas(600,400);
    background(0,255,0);
    createCars();
    rectMode(CENTER);
    noStroke(); 
}

function draw(){
    count+=1
    //calls create cars every 200 counts
    if (count%250==0){
        createCars();
    }
    //draws the road
    fill(223);
    rect(width/2,height/2,600,200);
    fill("yellow");
    //yellow stripes on road
    for(i=1;i<=8;i++){
        rect(i*600/9,height/2,50,15)
    }
    fill(0);
    //increases cars speed and then draws the car
    for (var i = 0;i<cars.length;i++){
        cars[i].draw();
        cars[i].x+=cars[i].speed;
    }
}

function createCars(){
    //randomly creates a car for either one or both lanes
    var carChance = floor(random(1,4));
    if (carChance == 1){
        cars.push(Car(1));
    }else if (carChance == 2){
        cars.push(Car(1));
        cars.push(Car(2));
    }else{
        cars.push(Car(2));
    }
}

function drawCar(){
    //draws the body of the car
    fill(this.R,this.G, this.B);
    rect(this.x,this.y,this.carWidth,this.carHeight,this.roundness);
    fill(255);
    //draws the hood of the car
    rect(this.x,this.y,20,30);
    fill(0);
    //draws the wheels of the car
    ellipse(this.x-this.carWidth/3, this.y+this.carHeight/2,20,5);
    ellipse(this.x+this.carWidth/3, this.y+this.carHeight/2,20,5);
    ellipse(this.x+this.carWidth/3, this.y-this.carHeight/2,20,5);
    ellipse(this.x-this.carWidth/3, this.y-this.carHeight/2,20,5);
}

function Car(lane){
    //depending on the lane sets the car to that lane and then changes the car direction and starting position
    if (lane == 1){
        heightY=150;
        direction = -1
        widthX=600;
    }else{
        heightY=250;
        direction = 1;
        widthX =0;
    }
    return {x: widthX,
            y: heightY,
            roundness: random(0,10),
            carHeight: random(30,70),
            carWidth: random(50,100),
            R: random(0,255),
            G: random(0,255),
            B: random(0,255),
            speed: direction * random(0.7,1),
            draw: drawCar
           }
}

14963482_1217758704913996_159518689_o

I thought it would be cool to do a birds eye view of a road simulation. I liked the fact that there was a lot you could do with the idea such as cars moving in different directions, and making sure that the cars don’t collide with each other.There was also a lot of variability that could be put into each car, such as its roundness, color, speed, and such. Overall I think it worked out decently, and although in the future perhaps it would be cool to add some more functionalities to it such as more color options or car models.

Hannah K-Looking Outwards-10

This week for my Looking Outwards, I looked at a project called Neurotiq by Sensoree. Sensoree began as a research endeavor focused on creating wearable technologies that augment Sensory Processing Disorder. Now, Sensoree Design Labs represents a cohort of designers and engineers that work with futuristic fabrics and materials.

Sensoree’s founder is Kristin Neidlinger, who is also a future concepts designer. I appreciated that this week’s Looking Outwards was directed at highlighting the amazing things that female creators are making.

Now, back to talking about Neurotiq. Neurotiq is a wearable piece of fashion that was knitted and 3D printed. It has EEG brain sensors that reflects the wearer’s thoughts and brain states, and it does so with colors. The EEG brain sensor captures brain waves. Neurotiq perfectly captures the bridge between science and art, as it is both beautiful and functional. Something that made me especially happy with this week’s Looking Outwards was that Sensoree had a process video for Neurotiq available, which is information that I have generally found difficult to obtain for past posts. The process video is below:

Here is a video of Neurotiq in action:

Neurotiq makes a visual representation of one's brain waves and thoughts possible.
Neurotiq makes a visual representation of one’s brain waves and thoughts possible.

Hannah K-Project-10

sketch-34.js

// Creates a forest with trees

var terrain = []; // Values of tree terrain unknown
var terrainL = terrain.length; // Returns length of terrain
var j;
var horTreeOff = 1; // Hor tree offset so top of tree is centered on trunk
var vertTreeOff = 10; // Vert tree offset so top of tree is on top of trunk
var a;
var b;
var c;
var d;
var e;
var f;
var g;
var h;
var i;
var forest1 = [];
var forest1L = forest1.length;
var forest2 = [];
var forest2L = forest2.length;
var forest3 = [];
var forest3L = forest3.length;

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

function draw() {
    background(135, 206, 235);

    // Draws the sun
    fill(253, 184, 19);
    ellipse(0, 0, 100, 100);

    createForest1();
    createForest2();
    createForest3();
    placeTrees1();
    placeTrees2();
    placeTrees3();
    calculateAndRenderTerrain();
    placeTreesOnTerrain(); 

}

function createForest1() {
    var noiseScale = 0.001;
    var forestDetail = 0.0005;
    var forestSpeed = 0.0001;

    // 1st "layer" of forest
    for(a = 0; a < width; a++) {
        b = (a * forestDetail * 10 + millis() * forestSpeed / 4);
        c = map(noise(b), 0, 1, 0, height-250);
        stroke(139, 143, 143);
        line(a, c, a, height);
    }
}

function createForest2() {
    var noiseScale = 0.005;
    var forestDetail = 0.0001;
    var forestSpeed = 0.0001;

    // 2nd "layer" of forest
    for (d = 0; d < width; d++) {
        e = (d * forestDetail * 10 + millis() * forestSpeed / 2);
        f = map(noise(e), 0, 1, 0, height-75);
           stroke(139, 150, 50);
           line(d, f + 20, d, height);
    }    
}

function createForest3() {
    var noiseScale = 0.001;
    var forestDetail = 0.0005;
    var forestSpeed = 0.0005;

    // 3rd "layer" of forest
    for (g = 0; g < width; g++) {
        h = (g * forestDetail * 7 + millis() * forestSpeed);
        i = map(noise(h), 0, 1, 0, height-60);
           stroke(139, 175, 63);
           line(g, i + 75, g, height);
    }    
}

// Places trees on hills of terrain
function placeTreesOnTerrain() {
  for(j = 1; j < width; j++) {
    if(terrain[j] < terrain[j+1] & terrain[j] < terrain[j-1]) {
    drawTree();
    }
  }
}

function drawTree() {
  noStroke();
  fill(139,69,19);  
  rect(j, terrain[j]-vertTreeOff, 5, 15);
  fill(85,107,47);
  ellipse(j+horTreeOff, terrain[j]-vertTreeOff, 15, 15);
}
 
// Code from Week 7's Assignment
function calculateAndRenderTerrain() {
  eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};
  if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}
  k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)
  {if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}
  ('c(6);b(4,6,4);9(a 3=0;3<d;3++){8[3]=e(h((3/7.0)+(g()/(7*4))),0,1,5*0.2,5);\
  f(3,8[3],3,5)}',18,18,'|||x|10|height|90|120|terrain|for|var|stroke|\
  noiseSeed|width|map|line|millis|noise'.split('|'),0,{}))
}

function placeTrees1() {
    for(a = 1; a < width; a++) {
        if(forest1[a] < forest1[a+1] & forest1[a] < forest1[a-1]) {
        drawTrees1();   
        }
    }
}

function drawTrees1() {
    noStroke();
    fill(139,69,19);  
    rect(a, forest1[a]-vertTreeOff, 5, 15);
    fill(85,107,47);
    ellipse(a+horTreeOff, forest1[a]-vertTreeOff, 15, 15);
}

function placeTrees2() {
    for(d = 1; d < width; d++) {
        if(forest2[d] < forest2[d+1] & forest2[d] < forest2[d-1]) {
        drawTrees2();   
        }
    }
}

function drawTrees2() {
    noStroke();
    fill(139,69,19);  
    rect(3, forest2[d]-vertTreeOff, 5, 15);
    fill(85,107,47);
    ellipse(d+horTreeOff, forest2[d]-vertTreeOff, 15, 15);

}

function placeTrees3() {
    for(g = 1; g < width; g++) {
        if(forest3[g] < forest3[g+1] & forest3[g] < forest3[g-1]) {
        drawTrees3();   
        }
    }
}

function drawTrees3() {
    noStroke();
    fill(139,69,19);  
    rect(3, forest3[g]-vertTreeOff, 5, 15);
    fill(85,107,47);
    ellipse(g+horTreeOff, forest3[g]-vertTreeOff, 15, 15);

}

This week’s project was definitely a bit of a struggle. I originally intended to create a forest with multiple layers of trees that appeared at the highest points of the created terrain (similar to an assignment we had to do for Week 7). The inspiration for a forest landscape was from this past summer, when I went camping with my family at Sequoia Kings Canyon. However, while there do not appear to be any bugs in my code, the trees are not showing up on the other “layers” of the forest (see below for a rough sketch of what I intended to create).
20161105_232633

Jinhee Lee; Project

jinheel1_project-10

//Jinhee Lee
//Section C
//jinheel1@andrew.cmu.edu
//Project-10

var buildings = [];
var ourLordandSaviour;

function preload() {
	ourLordandSaviour = loadImage("http://i.imgur.com/b4dYgGz.jpg"); //I don't know
}

function setup() {
    createCanvas(600, 400); 

    ourLordandSaviour.loadPixels();
    
    // create an initial collection of buildings
    for (var i = 0; i < 10; i++){
        var rx = random(width);
        buildings[i] = makeBuilding(rx);
    }
    frameRate(30);
}


function draw() {
	var skyCol = color(135,206,235);
    background(skyCol); //sky color backdrop

    image(ourLordandSaviour, 25, 0);
    
    displayGround(); //displaying grass

    updateAndDisplayBuildings();
    removeBuildingsThatHaveSlippedOutOfView();
    addNewBuildingsWithSomeRandomProbability(); 
}


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


function removeBuildingsThatHaveSlippedOutOfView(){
    // If a building has dropped off the left edge,
    // remove it from the array.  This is quite tricky, but
    // we've seen something like this before with particles.
    // The easy part is scanning the array to find buildings
    // to remove. The tricky part is if we remove them
    // immediately, we'll alter the array, and our plan to
    // step through each item in the array might not work.
    //     Our solution is to just copy all the buildings
    // we want to keep into a new array.
    var buildingsToKeep = [];
    for (var i = 0; i < buildings.length; i++){
        if (buildings[i].x + buildings[i].breadth > 0) {
            buildingsToKeep.push(buildings[i]);
        }
    }
    buildings = buildingsToKeep; // remember the surviving buildings
}


function addNewBuildingsWithSomeRandomProbability() {
    // With a very tiny probability, add a new building to the end.
    var newBuildingLikelihood = 0.007; 
    if (random(0,1) < newBuildingLikelihood) {
        buildings.push(makeBuilding(width));
    }
}


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

// draw the building and some windows
function buildingDisplay() {
    var floorHeight = 20;
    var bHeight = this.nFloors * floorHeight; 
    fill(255); 
    stroke(0); 
    push();
    translate(this.x, height - 40);
    rect(0, -bHeight, this.breadth, bHeight);
    fill("red"); //red windows and roofs
    triangle(0, -bHeight, //roofs
    	this.breadth, -bHeight, 
    	this.breadth/2, 3 / 2 * -bHeight);
    stroke(200); 

    for (var i = 0; i < this.nFloors; i++) {
        rect(5, -15 - (i * floorHeight), this.breadth - 10, 10);
    }
    pop();
}

function makeBuilding(birthLocationX) {
    var bldg = {x: birthLocationX,
                breadth: 50,
                speed: -1.0,
                nFloors: round(random(1,4)),
                move: buildingMove,
                display: buildingDisplay}
    return bldg;
}


function displayGround(){
	var groundCol = color(66, 244, 86);
	fill(groundCol);
    rect(0,height/2, width, height); 
}

I used the template and manipulated and added various elements to simulate a suburb.

P.S., This has been a very long week and weekend for me… I apologize for the lackluster submission. That said, I added in something that I hope will at least make someone smile, if not be impressed. Any partial credit received is greatly appreciated.

rgriswol_LookingOutwards-10

Chloe Varelidi is an indie game designer and developer. One of her projects, Pandemoji, is “a silly classroom game which uses a webcam and face recognition software to provide a playful opportunity for tweens to talk about their emotions.”

A screenshot captured from the game.

Her code is located here. The way the game works is a person stands in front of a webcam and watches “Pandemojis” (which are exactly what they sound like: panda emojis) fall from above. They then move and “catch” one to wear on their (virtual) face. A countdown is given and then a screenshot is taken. The goal of this is for the images to later be used in a classroom discussion of emotions and specifically how we express emotions through our facial expressions.

rgriswol_project-10

For this project, I wanted to keep the landscape design relatively simple so I could focus on actually understanding what I was coding.

14970848_715351418614051_1096240396_o

sketch

/*
* Rachel Griswold
* rgriswol@andrew.cmu.edu
* Section B
* Project 10
*
*/

var terrainSpeed = 0.0003; //speed of hills
var terrainDetail = 0.005;
var terrain = [];
var treeX = [];
var treeY = [];
var treeN = [];
var cloudX = [];
var cloudY = [];



function updateLocation(){ //moves the trees + clouds
	for(i = 0; i < treeN.length; i++){
		treeX[i] = treeX[i] - 1;
			if(treeX[i] < -50){ //makes the trees go away
				treeX.splice(i,1);
				treeY.splice(i,1);
				treeN.splice(i,1);
			}
	}
	for(i = 0; i < cloudX.length; i++){
		cloudX[i] = cloudX[i] - 1;
			if(cloudX[i] < -50){ //makes the clouds go away
				cloudX.splice(i,1);
				cloudY.splice(i,1);
			}
	}
}


function drawTree1(x, y){ // creates tree type 1
	var tw = 20; // tree width
	var th = 70; // tree height
	fill(80, 40, 20);
	rect(x, y, tw, th); // tree trunk
	//tree leaves
	fill(150, 230, 80);
	ellipse(x + tw/2, y - 20, 40, 40);
	ellipse(x, y, 40, 40);
	ellipse(x + tw, y, 40, 40);
}

function drawTree2(x, y){ // creates tree type 2
	var tw = 10; // tree width
	var th = 40; // tree height
	fill(80, 40, 20);
	rect(x, y, tw, th); // tree trunk
	//tree leaves
	fill(150, 230, 80);
	ellipse(x + tw/2, y - 25, 50, 50);
}

function drawTree3(x, y){ // creates tree type 3
	var tw = 15; // tree width
	var th = 50; // tree height
	fill(80, 40, 20);
	rect(x, y, tw, th); // tree trunk
	//tree leaves
	fill(150, 230, 80);
	ellipse(x, y, 30, 30);
	ellipse(x + tw, y, 30, 30);
	ellipse(x, y - 20, 30, 30);
	ellipse(x + tw, y - 20, 30, 30);
}

function drawTrees(){ //places trees
	for(i = 0; i < treeX.length; i++){
		if(treeN[i] == 1){
			drawTree1(treeX[i], treeY[i]);
		}
		if(treeN[i] == 2){
			drawTree2(treeX[i], treeY[i]);
		}
		if(treeN[i] == 3){
			drawTree3(treeX[i], treeY[i]);
		}
	}
}

function drawCloud(x, y){ //creates cloud
	var cw = 80;
	var ch = 20;
	fill(255);
	ellipse(x, y, cw, ch);
}

function drawClouds(){ //places clouds
	for(i = 0; i < cloudX.length; i++){
		drawCloud(cloudX[i], cloudY[i]);
	}

}


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

function draw() {
    background(190, 240, 255);

    drawClouds();
    if(random(0, 100) < 1){
    	cloudX.push(620);
    	cloudY.push(random(20, 200));
    }
    
    noStroke();
    fill(0, 80, 0);
    beginShape(); //creates "noise" for hill background
    vertex(0,height);
    for (var x = 0; x < width; x++) {
        var t = (x * terrainDetail) + (millis() * terrainSpeed);
        var y = map(noise(t), 0,1, 0, height);
        vertex(x, y); 
    }
    vertex(width,height);
    endShape(CLOSE);

    fill(0, 120, 0); //creates foreground
    rect(0, 300, 600, 400);

    drawTrees();
    updateLocation();

    if(random(0, 100) < 1){
    	treeX.push(620);
    	treeY.push(300);
    	var n = random(0,3);
    	if(n < 1){
    		treeN.push(1);
    	}
    	else if(n < 2){
    		treeN.push(2);
    	}
  		else{
  			treeN.push(3);
  		}
    }

}