mreyes-project-11-turtle drawing tool

sketch

//Mercedes Reys

//Section C 

//mreyes@andrew.cmu.edu

//project-11

//trutle varaibles 
var t1;
var t2;
var t3;
var t4;
function setup() {

    createCanvas(800, 800);
    background('pink');
    //turtles 
    t1 = makeTurtle(width / 2 , height / 2);
    t2 = makeTurtle(width / 2 , height / 2);
    t3 = makeTurtle(width / 2 , height / 2);
    t4 = makeTurtle(width / 2 , height / 2);
  
}
 
function draw() {
//turtles move forward twards target 
    t1.forward(1);
    t2.forward(1);
    t3.forward(1);
    t4.forward(1);
// target is mouse location
    var targetX = mouseX;
    var targetY = mouseY;
    strokeWeight(1);
    stroke(128);
// turtles move tward target but at varying amounts 
    t1.turnToward(targetX, targetY,1);
    t2.turnToward(targetX, targetY,2);
    t3.turnToward(targetX, targetY,3);
    t4.turnToward(targetX, targetY,4);


}


function turtleLeft(d){this.angle-=d;}function turtleRight(d){this.angle+=d;}
function turtleForward(p){var rad=radians(this.angle);var newx=this.x+cos(rad)*p;
var newy=this.y+sin(rad)*p;this.goto(newx,newy);}function turtleBack(p){
this.forward(-p);}function turtlePenDown(){this.penIsDown=true;}
function turtlePenUp(){this.penIsDown = false;}function turtleGoTo(x,y){
if(this.penIsDown){stroke(this.color);strokeWeight(this.weight);
line(this.x,this.y,x,y);}this.x = x;this.y = y;}function turtleDistTo(x,y){
return sqrt(sq(this.x-x)+sq(this.y-y));}function turtleAngleTo(x,y){
var absAngle=degrees(atan2(y-this.y,x-this.x));
var angle=((absAngle-this.angle)+360)%360.0;return angle;}
function turtleTurnToward(x,y,d){var angle = this.angleTo(x,y);if(angle< 180){
this.angle+=d;}else{this.angle-=d;}}function turtleSetColor(c){this.color=c;}
function turtleSetWeight(w){this.weight=w;}function turtleFace(angle){
this.angle = angle;}function makeTurtle(tx,ty){var turtle={x:tx,y:ty,
angle:0.0,penIsDown:true,color:color(128),weight:1,left:turtleLeft,
right:turtleRight,forward:turtleForward, back:turtleBack,penDown:turtlePenDown,
penUp:turtlePenUp,goto:turtleGoTo, angleto:turtleAngleTo,
turnToward:turtleTurnToward,distanceTo:turtleDistTo, angleTo:turtleAngleTo,
setColor:turtleSetColor, setWeight:turtleSetWeight,face:turtleFace};
return turtle;}

I wanted to make a little interactive turtle sketch that would draw follow your mouse and draw varying compositions. The code is simple, but I think the program is fairly intuitive and entertaining. Depending on how you move your mouse around and how long you play with it the composition can get messy, but overall it generates fairly pleasing designs.

screen-shot-2016-11-11-at-11-33-26-pmscreen-shot-2016-11-11-at-11-38-59-pmscreen-shot-2016-11-11-at-11-39-30-pm

GarrettRauck-project-11 (Click to add turtles)

sketch

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

/////////////////////////////////
// INIT VARIABLES
/////////////////////////////////
//canvas vars
var canvasWidth, canvasHeight;

//INPUT IMAGE
//option 1:
//var imgUrl = "http://i.imgur.com/b24JQcX.jpg?1"; // url for the input image
//option 2:
var imgUrl = "http://i.imgur.com/koPvfoe.jpg"; // url for the input image

var img; //the input image object

//2d list of booleans tracking which pixels have been visited
//visited = true; not visited = false
var visitedPixels = [];

//
var turtles = []; //store all turtle instances in list
var newTurtles = []; //store turtles to add on next frame
var deadTurtles = []; //store turtles to remove on next frame
var colorTurtle, colorBackground;

//
var darknessThreshold, brightnessThreshold;
var maxNumberOfTurtles;

/////////////////////////////////
// RUN!
/////////////////////////////////
function preload() {
	img = loadImage(imgUrl);
}

function setup() {
	// INIT VARS
	//set canvas size based on imput image
	canvasWidth = 800;
	canvasHeight = 800;
	//set control variables
	darknessThreshold = 50;
	brightnessThreshold = 70;
	maxNumberOfTurtles = 25;
	//set colors
	colorTurtle = color(255);
	colorBackground = color(0);

	//populate visited pixels list such that it is a 2d list of booleans
	//representing each pixel in the canvas. false means that the pixel
	//has not been visited by turtles yet.
	for (var y = 0; y < canvasHeight; y++) {
		//create list to store row of values
		var row = [];
		//populate row list with all falses for n columns
		for (var x = 0; x < canvasWidth; x++) {
			row.push(false);
		}
		//add row list to 2d visitedPixels array
		visitedPixels.push(row);
	}

	// CANVAS SETUP
    createCanvas(canvasWidth, canvasHeight);
    background(colorBackground);
}

function draw() {
	//if program termination condition hasn't been met...
	if (fin() != true) {
		//for each turtle in list of active turtles...
		for (var i=0; i<turtles.length; i++) {
			//get turtle object
			var turtle = turtles[i];
			//walk
			walkTurtle(turtle);
		}
	}
	//add new turtles to list of all turtles for next generation
	updateTurtlesList();
}

/////////////////////////////////
// HELPER FNS
/////////////////////////////////
function walkTurtle(turtle) {
	//start drawing
	turtle.penDown();
	//move forward 1 pixel
	turtle.forward(1);
	//check if pixel visited already, continue if unvisited
	if (isValidStep(turtle)) {
		var x = int(turtle.x); //sometimes these values become floats...
		var y = int(turtle.y); //so use int() to ensure integer value
		//determine turtle's fate based on pixel brightness:
		var pix = img.get(x,y);

		//if pixel too dark, turtle dies
		if (brightness(pix) > darknessThreshold) {
			// println("Turtle die!");
			killTurtle(turtle);
		}
		//else if pixel bright enough, spawn children turtles at location
		else if (brightness(pix) > brightnessThreshold) {
			println("Spawn!")
			spawnTurtle(x, y, 90); //spawn turtle to left
			spawnTurtle(x, y, -90); //spawn turtle to right
		}
		else {
		}
	}
	//else, if pixel is visited already, erase. Then, respawn elsewhere
	else {
		// println("Respanw!");
		//move backward 1 pixel
		turtle.back(1);
		//respawn somewhere else
		respawnTurtle(turtle);
	}
}

function isValidStep(turtle) {
	//get x and y pixel position of turtle
	var x = int(turtle.x); //sometimes these values become floats...
	var y = int(turtle.y); //so use int() to ensure integer value
	//if turtle off of canvas
	if ((x <= 0) || (x >= canvasWidth) || (y <= 0) || (y >= canvasHeight)) {
		return false;
	}
	//if pixel already visited, step is not valid. return false
	else if (visitedPixels[x][y] == true) {return false;}
	//if pixel not visited, step is valid. return true
	else {
		//update visited pixels
		visitedPixels[x][y] = true;
		return true;
	}
}

function spawnTurtle(x,y,dir) {
	if (turtles.length < maxNumberOfTurtles) {
		//create new turtle instance
		var turtle = makeTurtle(x,y);
		//rotate turtle based on input dir
		turtle.left(dir);
		//set turtle color
		turtle.color = colorTurtle;
		//store turtle in list of turtles to be added to master list
		newTurtles.push(turtle);
	}
}

function respawnTurtle(turtle) {
	//get random x and y pixel coordinates
	var x = int(random(canvasWidth));
	var y = int(random(canvasHeight));
	var theta = 90*(int(random(4)));
	//move turtle to new pixel
	turtle.penUp();
	turtle.goto(x,y);
	turtle.penDown();
	//turn turtle
	turtle.left(theta);
	//if move is to a cell that hasn't been visit, continue
	if (isValidStep(turtle)) {
		//update visited pixels
		visitedPixels[x][y] = true;
		//exit function
		return;
	}
	//if move is to cell that has already been visited, try again
	else {respawnTurtle(turtle);}
}

//function to remove turtle from list of active turtles
function killTurtle(turtle) {
	deadTurtles.push(turtle);
	// //new list to store all active turtles
	// var newTurtlesList = [];
	// //get index of turtle to remove from list of turtles
	// var indexOfTurtleToRemove = turtles.indexOf(turtle);
	// println(indexOfTurtleToRemove ==
	// //loop over list of turtles, build new list, excluding newly dead turtle
	// for (var i=0; i<turtles.length; i++) {
	// 	//if turtle is not the one we are killing, add it to the list
	// 	if (i != indexOfTurtleToRemove) {newTurtlesList.push(turtles[i]);}
	// }
	// //update turtles list
	// turtles = newTurtlesList;
}

//function for adding newly spawned turned to list of active turtles
function updateTurtlesList(){
	var newTurtlesList = [];
	for (var i=0; i<turtles.length; i++) {
		if ((deadTurtles.indexOf(turtles[i])) == -1) {
			newTurtlesList.push(turtles[i]);
		}
	}
	//for each new turtle spawned in past generation...
	for (var j=0; j<newTurtles.length; j++) {
		//add new turtle to list of active turtles
		newTurtlesList.push(newTurtles[j]);
	}
	turtles = newTurtlesList;
}

// function for ending the program if all cells have been visited
function fin() {
	//check if cells have been visited or not
	for (var x=0; x<visitedPixels.length; x++) {
		for (var y=0; y<visitedPixels[0].length; y++) {
			//if any cell is found unvisited, return false to continue program
			if (visitedPixels[x][y] == false) {
				return false;
			}
		}
	}
	//if get through all cells and all have been visited, finish
	return true;
}

/////////////////////////////////
// EVENTS
/////////////////////////////////
function mousePressed() {
	//spawn new turtle at mouse x and y with random N/S/E/W direction
	spawnTurtle(int(mouseX),int(mouseY),90*(int(random(4))));
}

/////////////////////////////////
// TURTLE CLASS
/////////////////////////////////
function turtleLeft(d){this.angle-=d;}function turtleRight(d){this.angle+=d;}
function turtleForward(p){var rad=radians(this.angle);var newx=this.x+cos(rad)*p;
var newy=this.y+sin(rad)*p;this.goto(newx,newy);}function turtleBack(p){
this.forward(-p);}function turtlePenDown(){this.penIsDown=true;}
function turtlePenUp(){this.penIsDown = false;}function turtleGoTo(x,y){
if(this.penIsDown){stroke(this.color);strokeWeight(this.weight);
line(this.x,this.y,x,y);}this.x = x;this.y = y;}function turtleDistTo(x,y){
return sqrt(sq(this.x-x)+sq(this.y-y));}function turtleAngleTo(x,y){
var absAngle=degrees(atan2(y-this.y,x-this.x));
var angle=((absAngle-this.angle)+360)%360.0;return angle;}
function turtleTurnToward(x,y,d){var angle = this.angleTo(x,y);if(angle< 180){
this.angle+=d;}else{this.angle-=d;}}function turtleSetColor(c){this.color=c;}
function turtleSetWeight(w){this.weight=w;}function turtleFace(angle){
this.angle = angle;}function makeTurtle(tx,ty){var turtle={x:tx,y:ty,
angle:0.0,penIsDown:true,color:color(128),weight:1,left:turtleLeft,
right:turtleRight,forward:turtleForward, back:turtleBack,penDown:turtlePenDown,
penUp:turtlePenUp,goto:turtleGoTo, angleto:turtleAngleTo,
turnToward:turtleTurnToward,distanceTo:turtleDistTo, angleTo:turtleAngleTo,
setColor:turtleSetColor, setWeight:turtleSetWeight,face:turtleFace};
return turtle;}

In this sketch, I was trying to have a series of turtles walk about an image and respond based on the brightness of the pixels. The rules I was attempting to employ:

  1. When a turtle reaches a pixel that is brighter than a certain value, spawn two child turtles to the left and to the right.
  2. When a turtle reaches a pixel that is darker than a certain value, that turtle “dies”.
  3. If a turtle reaches a pixel that has already been visited by another turtle, or if the turtle runs off the canvas, that turtle respawns to another random location.

What I was able to achieve creates an interesting composition; however, I don’t think it is reacting to the image as I intended.

Looking Outwards 11 Lydia Jin

Computational Design of Metallophone Contact Sounds

I found this interesting computational design of sound online at this website. This project uses the technology of 3D printing to create specified shapes that makes sound. The parts include 3 sub parts: the mallet, fabricated shape, and the optimized stand. The parts have animal shapes that are very precisely calculated to make sure the best outcome of the sound comes out. It combines engineering and acoustic design skills. The project was created in 2013 and from this work, we can assume that the artist pays heavy attention to detail. I really like this project because it combines music and art in the most creative ways. And I admire how precise the pieces are, especially when it is made using innovative technology such as 3D printing.

mdambruc-Project-11

sketch

//Mairead Dambruch
//mdambruc@andrew.cmu.edu
//Section C
//Project-11-A
function turtleLeft(d) {
    this.angle -= d;
}


function turtleRight(d) {
    this.angle += d;
}


function turtleForward(p) {
    var rad = radians(this.angle);
    var newx = this.x + cos(rad) * p;
    var newy = this.y + sin(rad) * p;
    this.goto(newx, newy);
}


function turtleBack(p) {
    this.forward(-p);
}


function turtlePenDown() {
    this.penIsDown = true;
}


function turtlePenUp() {
    this.penIsDown = false;
}


function turtleGoTo(x, y) {
    if (this.penIsDown) {
      stroke(this.color);
      strokeWeight(this.weight);
      line(this.x, this.y, x, y);
    }
    this.x = x;
    this.y = y;
}


function turtleDistTo(x, y) {
    return sqrt(sq(this.x - x) + sq(this.y - y));
}


function turtleAngleTo(x, y) {
    var absAngle = degrees(atan2(y - this.y, x - this.x));
    var angle = ((absAngle - this.angle) + 360) % 360.0;
    return angle;
}


function turtleTurnToward(x, y, d) {
    var angle = this.angleTo(x, y);
    if (angle < 180) {
        this.angle += d;
    } else {
        this.angle -= d;
    }
}


function turtleSetColor(c) {
    this.color = c;
}


function turtleSetWeight(w) {
    this.weight = w;
}


function turtleFace(angle) {
    this.angle = angle;
}


function makeTurtle(tx, ty) {
    var turtle = {x: tx, y: ty,
                  angle: 0.0,
                  penIsDown: true,
                  color: color(128),
                  weight: 1,
                  left: turtleLeft, right: turtleRight,
                  forward: turtleForward, back: turtleBack,
                  penDown: turtlePenDown, penUp: turtlePenUp,
                  goto: turtleGoTo, angleto: turtleAngleTo,
                  turnToward: turtleTurnToward,
                  distanceTo: turtleDistTo, angleTo: turtleAngleTo,
                  setColor: turtleSetColor, setWeight: turtleSetWeight,
                  face: turtleFace};
    return turtle;
}
var hotdog = [];//hotdog array
var turtle1;
var startFrame;
var lightening;//sound file

function preload(){
//  lightening2 = loadSound("lightening2.wav");//background sound
}

function setup() {
    createCanvas(800, 400);
    background(0);
  //  lightening2.play(0, 1, 2);//background sound
    for (var i = 0; i < 100; i++){
      var hotdogplace = random(width);
      hotdog[i]= makehotdog(hotdogplace);
      turtle1 = makeTurtle(mouseX, mouseY);//create turtle
      turtle1.setColor(color(255));
      turtle1.setWeight(2);
      turtle1.penDown();//creating lightening turtle
      resetCanvas();
      frameRate(100);
}
}
function draw() {
  //creating striped background
  colorMode(RGB);
  noStroke();
  from = color(48, 138, 191);
  to = color(200, 255, 50);
  interA = lerpColor(from, to, .33);
  interB = lerpColor(from, to, .66);
  fill(from);
  rect(0, 0, width, 100);
  fill(interA);
  rect(0, 100, width, 200);
  fill(interB);
  rect(0, 200, width, 300);
  fill(to);
  rect(0, 300, width, 400);
  sloth();
  updateandcreatehotdogs();
  removehotdog();
  addnewhotdog();
  showhotdog();
  makehotdog();
  //draws lightening
  var step = (random(width) - random(height));
  turtle1.forward(step);
  turtle1.left(1000);
  if (turtle1.y > width || turtle1.x > height)
  resetCanvas();
}
function resetCanvas(){//creates flashing background after turtle is drawn
  background(0);
  startFrame = frameCount;
  turtle1.penUp();
  turtle1.goto(400, 300);
  turtle1.penDown();
}
function updateandcreatehotdogs(){
    for (var i = 0; i < hotdog.length; i = i + 20){
        hotdog[i].move();
        hotdog[i].display();
}
}
function removehotdog(){ //removes hotdogs after past canvas
    var hotdogToKeep = [];
    for (var i = 0; i < hotdog.length; i++){
        if (hotdog[i].x + hotdog[i].breadth > 0) {
            hotdogToKeep.push(hotdog[i]);
    }
    }
    hotdog = hotdogToKeep;
}
function addnewhotdog() {
    var newhotdogProbability = 0.5;
    if (random(0, 1) < newhotdogProbability) {
        hotdog.push(makehotdog(width));
    }
}
function hotdogmove() {
    this.x += this.speed;
}
function showhotdog() {
    var hotdogHeight = 10;

	  push();
    noStroke();

    //draws four lines of hotdogs

    translate(this.x, 30);
    fill(255, 111, 91);
    ellipse(0, hotdogHeight, 25, 7);
    rectMode(RADIUS);
    fill(240, 182, 66);
    rect(0, hotdogHeight+2, 8, 3);

    translate(this.x, 80);
    fill(255, 111, 91);
    ellipse(0, hotdogHeight, 25, 7);
    rectMode(RADIUS);
    fill(240, 182, 66);
    rect(0, hotdogHeight+2, 8, 3);

    translate(this.x, 100);
    fill(255, 111, 91);
    ellipse(0, hotdogHeight, 25, 7);
    rectMode(RADIUS);
    fill(240, 182, 66);
    rect(0, hotdogHeight+2, 8, 3);

    translate(this.x, 130);
    fill(255, 111, 91);
    ellipse(0, hotdogHeight, 25, 7);
    rectMode(RADIUS);
    fill(240, 182, 66);
    rect(0, hotdogHeight+2, 8, 3);

    pop();
}
function makehotdog(LocationX) {
    var hdog = {x: LocationX,
                breadth: 1000,
                speed: -1.0,
                nstars: round(random(2,8)),
                move: hotdogmove,
                display: showhotdog}
    return hdog;
}
function sloth(x, y){
  //draws sloth
  x = 400;
  y = 350;
  noStroke();
  fill(140, 70, 0);
  ellipse(x, y, 20, 50);
  ellipse(x, y - 40, 30, 30);
  ellipse(x, y + 10, 35, 30);
  //face and body
  ellipse(x + 7, y + 20, 10, 20);
  ellipse(x - 7, y + 20, 10, 20);
  fill(255, 218, 117);
  ellipse(x, y - 40, 20, 20);
  //innerface
  fill(214, 135, 32);
  ellipse(x, y - 40, 17, 8);
  ellipse(x, y - 37, 10, 10 )
  //surrounding eye area
  fill(0);
  ellipse(x - 5, y - 40, 5, 5);
  fill(0);
  ellipse(x + 5, y - 40, 5, 5);
  //eyes
  fill(0);
  ellipse(x + 1, y - 37, 2, 2);
  fill(0);
  ellipse(x - 1, y - 37, 2, 2);
  //nostrils
  noStroke();
  fill(255, 0, 0);
  arc(x, y-34, 5, 5, TWO_PI, PI, CHORD);
  //mouth
}

For this project, I created a sloth-like creature that is continuously getting electrically shocked in the head by lightening in a hotdog storm. The lightening is created by turtles. I originally had lightening sounds that accompanied this project but was unable to have that due to the need of a local server.

Here is a screenshot of the project

screen-shot-2016-11-11-at-10-08-22-pm

Sarita Chen – Project 11 – Composition (Please click)

sketch

var spacing;
var turtle;

function setup() {
  createCanvas(600,400);
    background(0);
    var turtle = makeTurtle(width/2,height/2);
    spacing = 2;
    turtle.setColor('Pink'); //Changing colour of hexagons to yellow
        
   for(var i = 0; i <100; i++){
   turtle.right;
   turtle.forward(5);

   turtle.right(144);
   turtle.forward(5);

   turtle.left(72);
   turtle.forward(5);

   turtle.right(144);
   turtle.forward(5);

   turtle.left(72);
   turtle.forward(5);
   
   turtle.right(144);
   turtle.forward(5);  

   turtle.left(72);
   turtle.forward(5);
    
   turtle.right(144);
   turtle.forward(5); 

   turtle.left(72);
   turtle.forward(5);

   turtle.right(144);
   turtle.forward(5);


   turtle.right(60); //Rotating hexagon by the golden angle
    turtle.forward(); // Incrementing the distance
    }
}

function mousePressed(){
var turtle = makeTurtle(width/2,height/2);
turtle.setColor('Pink');
  if (spacing === 2){
    
  for(var i = 0; i <100; i++){
   turtle.right;
   turtle.forward(5);

   turtle.right(144);
   turtle.forward(5);

   turtle.left(72);
   turtle.forward(5);

   turtle.right(144);
   turtle.forward(5);

   turtle.left(72);
   turtle.forward(5);
   
   turtle.right(144);
   turtle.forward(5);  

   turtle.left(72);
   turtle.forward(5);
    
   turtle.right(144);
   turtle.forward(5); 

   turtle.left(72);
   turtle.forward(5);

   turtle.right(144);
   turtle.forward(5);


   turtle.right(60); //Rotating hexagon by the golden angle
    turtle.forward(random(i*spacing*10)); // Incrementing the distance
    }
}

  } 


      
function turtleLeft(d){this.angle-=d;}function turtleRight(d){this.angle+=d;}
function turtleForward(p){var rad=radians(this.angle);var newx=this.x+cos(rad)*p;
var newy=this.y+sin(rad)*p;this.goto(newx,newy);}function turtleBack(p){
this.forward(-p);}function turtlePenDown(){this.penIsDown=true;}
function turtlePenUp(){this.penIsDown = false;}function turtleGoTo(x,y){
if(this.penIsDown){stroke(this.color);strokeWeight(this.weight);
line(this.x,this.y,x,y);}this.x = x;this.y = y;}function turtleDistTo(x,y){
return sqrt(sq(this.x-x)+sq(this.y-y));}function turtleAngleTo(x,y){
var absAngle=degrees(atan2(y-this.y,x-this.x));
var angle=((absAngle-this.angle)+360)%360.0;return angle;}
function turtleTurnToward(x,y,d){var angle = this.angleTo(x,y);if(angle< 180){
this.angle+=d;}else{this.angle-=d;}}function turtleSetColor(c){this.color=c;}
function turtleSetWeight(w){this.weight=w;}function turtleFace(angle){
this.angle = angle;}function makeTurtle(tx,ty){var turtle={x:tx,y:ty,
angle:0.0,penIsDown:true,color:color(128),weight:1,left:turtleLeft,
right:turtleRight,forward:turtleForward, back:turtleBack,penDown:turtlePenDown,
penUp:turtlePenUp,goto:turtleGoTo, angleto:turtleAngleTo,
turnToward:turtleTurnToward,distanceTo:turtleDistTo, angleTo:turtleAngleTo,
setColor:turtleSetColor, setWeight:turtleSetWeight,face:turtleFace};
return turtle;}

 

It’s supposed to resemble those constellation diagrams, sort of like connect the dots in a way. Originally I had just planned to use the method from last week’s assignment B, but I decided to do this instead and make it interactive.

screen-shot-2016-11-11-at-9-29-34-pm

 

LookingOutwards-11-mdambruc

Zimoun

http://www.zimoun.net/video.html

 

 

157 prepared dc-motors, cotton balls, cardboard boxes 60x20x20cm

Zimoun 2014

screen-shot-2016-11-11-at-12-10-38-pm

Picture of installation

Video of Piece

Since in week 4 I wrote about a piece of music, this week I decided to choose sound artist Zimoun, a swiss artist located in Bern, Switzerland. With Zimoun’s piece “157 prepared dc-motors, cotton balls, cardboard boxes 60x20x20cm” I really enjoy his use of space. Zimoun specializes in creating large-scale sound sculptures composed with simple and functional components. I really admire how he uses simple materials such as cardboard and balls to create grand immersive sculptures. Zimoun uses prepared systems to control the dc-motors in his piece, allowing for him to compute the movements they create. Zimoun is truly an artist who is capable of creating complex imagery and sound from simple space and simple machines. I admire his efficiency and ability to make great art out of commonplace objects, because it proves that great art does not need to be expensive to create. It is art of the common people.

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/

 

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

LookingOutwards-10-mdambruc

Camille Utterback, Entangled 2015

video of Utterback’s piece Entangled

http://camilleutterback.com/projects/entangled/

I was first drawn to choose Camille Utterback because of her works focusing on permanent public art and installations. I enjoy Utterback’s fascination with the correspondence between linking computational systems to human movement. Utterback’s concentration of interaction between humans and computers led me to choose her piece “Entanglement”. This piece is made up of three layers of fabric that has projected images on them. These images are interactive – throughout the piece, “tangles” of cords will appear that are able to be moved by motions by the viewer. Also, as the viewer walks around the piece, their profile is cast onto the fabric. On the other side of the fabric, their form becomes merely a murky figure. Utterback describes this overlapping imagery as a “mutually negotiated space”. Utterback is an Assistant Professor in Art at Stanford University. She holds a BA in Art from Williams College. She currently lives and works in San Francisco, California.

 

mdambruc-Project-10

sketch

//Mairead Dambruch
//mdambruc@andrew.cmu.edu
//Section C
//Project 10
var seaweed = [];
var speed = .5;
var fishes = [];
function setup() {
  createCanvas(600, 400);
  //creating random occurrences of seaweed placement
  for (var i = 0; i < 50; i++){
  var rx = random(width);
  var ry = random(height);
  seaweed[i] = makeSeaweed(rx);
  fishes[i] = makeFishes(rx, ry);
  }
  frameRate(5);
  }

function draw() {
  background(color(10, 75, 88));
  //draw sand
  sand();
  //draw and update seaweed
  showUpdateSeaweed();
  removeOldSeaweed();
  addSeaweed();
  //draw fishes
  showUpdateFishes();
  removeOldFishes();
  addFishes();
}
//creates new seaweeds at beginning of image
function showUpdateSeaweed(){
  for (var i = 0; i < seaweed.length; i++){
  seaweed[i].move();
  seaweed[i].display();
  }
  }
//creates new fishes at beginning of image
function showUpdateFishes(){
  for (var i = 0; i < fishes.length; i++){
  fishes[i].move();
  fishes[i].display();
  }
  }
//removes seaweed when seaweed goes past canvas
function removeOldSeaweed(){
  var keepSeaweed = [];
  for (var i = 0; i < seaweed.length; i++){
  if (seaweed[i].x + seaweed[i].breadth > 0) {
      keepSeaweed.push(seaweed[i]);
    }
    }
  seaweed = keepSeaweed;
  }
//removes fishes once out of canvas
function removeOldFishes(){
    var keepfishes = [];
    for (var i = 0; i < fishes.length; i++){
    if (fishes[i].x > 0) {
      keepfishes.push(fishes[i]);
      }
      }
    fishes = keepfishes;
    }
function addSeaweed(){
  //will create seaweed 50% of the time
  var newSeaweed = 0.5;
  if (random(0,1) < newSeaweed){
     seaweed.push(makeSeaweed(width));
  }
  }
function addFishes(){
  var newFishes= 0.5;
  if (random(0,1) < newFishes){
       fishes.push(makeFishes(width, random(5, 10)));
  }
  }
//allows for seaweed to move offscreen
function moveSeaweed(){
  this.x += this.speed;
  }
function moveFishes(){
  this.x += this.speed;
  this.y += this.speed;
  }
function showSeaweed(){
  //places seaweed at proper place in sand
  var sandHeight = 5;
  var offset = 15;
  //created randomized height of seaweed
  var weedHeight = this.nGrowth * sandHeight;
  strokeWeight(1);
  push();
  translate(this.x, height - offset);
  fill("Green");
  rect(0, -weedHeight, this.breadth, weedHeight);
  stroke(50);
  var bubbleLen = 3;
  var bubblestart = 5;
  var bubbleend = 10;
  //creates bubbles flowing out of seaweed
  for (var i = 0; i < this.nGrowth; i++) {
  fill("lightBlue");
  noStroke();
  ellipse(bubblestart, -bubbleend - (i * weedHeight), bubbleLen, bubbleLen);
}
  pop();
}
//draws fishes
function showFishes(){
  push();
  translate(this.x, this.y);
  noStroke();
  fill("Salmon");
  //fish body
  ellipse(0, 0, 15, 10);
  //fishtail
  triangle(5, 0, 14, 10, 14, -5);
  //fisheye
  ellipse (2, 2, 2, 2);
  pop();
}
function makeSeaweed(LocationX) {
    var sweed = {x: LocationX,
                breadth: 5,
                speed: -10,
                nGrowth: round(random(2,20)),
                move: moveSeaweed,
                display: showSeaweed}
    return sweed;
  }
function makeFishes(LocationX, LocationY) {
      var fishes = {x: LocationX,
                  y : LocationY,
                  breadth: 10,
                  speed: -random(1, 10),
                  move: moveFishes,
                  display: showFishes}
      return fishes;
    }
function sand(){
  strokeWeight(5);
  for (var i = 0; i < width; i++) {
  //creates randomized terrain
  var gradient = noise(i * .004 + millis() * speed)
  var s = height - .20 * height * gradient;
  stroke(color(240, 229, 144));
  line(i, height, i, s);
}
}

img_5756

For this assignment, I wanted to create an underwater scene which featured a school of fish passing by. Being hesitant with objects, I started to begin simply with them by creating the seaweed. I then added the bubbles coming out of the seaweed. Then, I added the fishes as objects, in attempts to further understand how objects work. With every new element in the animation, I grew to be more comfortable with objects and how they interact – both to each other and to surrounding code. I’m looking forward to being able to create more animations with ease now using objects. Prior to this assignment I was confused by the uses of “this” and how helper functions were used. After this assignment, I am more comfortable with objects.