ICM WEEK 4: I SEE THE LIGHT

ICMweek4

var moon = {
x: 500,
y: 650,
display: function() {
stroke(0);
strokeWeight(13);
ellipse(this.x, this.y, 300, 300);
},
move: function() {
this.x = this.x + random(-2, 2);
this.y = this.y + random(-2, 2);

// var road = {
// x1: -5,
// y1: 945,
// x2: 490,
// y2: 255,
// x3: 510,
// y3: 255,
// x4: 1005,
// y4: 945,

// display: function() {
// stroke(255, 204, 0);
// strokeWeight(5);
// fill(238, 229, 222);
// quad(this.x1, this.y1, this.x2, this.y2, this.x3, this.y3, this.x4, this.y4); //road Not working 😦 ROAD OBJECT
}
}

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

function draw() {
background(255, 174, 185);
text(mouseX, 10, 20);
text(mouseY, 20, 30);
// road.display(); //not working 😦 ROAD OBJECT
stroke(255, 204, 0);
strokeWeight(5);
fill(238, 229, 222);
quad(-5, 945, 490, 255, 510, 255, 1005, 945); //road

stroke(255, 204, 0);
strokeWeight(7);
drawMoon(500, 110, 300, 0, 0, 255); //centermoon

moon.move();
moon.display();

push(); //centerstar
translate(500, 110);
rotate(frameCount / 90.0); //frame
star(0, 0, 80, 100, 40);
pop();
stroke(255, 204, 0);
strokeWeight(7);

drawMoon(100, 110, 300, 255, 0, 0);

push(); //leftstar
translate(100, 110);
rotate(frameCount / 90.0);
star(0, 0, 80, 100, 40);
pop();

drawMoon(900, 110, 300);

push(); //rightstar
translate(900, 110);
rotate(frameCount / 90.0);
star(0, 0, 80, 100, 40);
pop();

drawMoon(300, 90, 100);
drawMoon(700, 90, 100);
drawMoon(100, 110, 100);
drawMoon(900, 110, 100);

drawLamp(50, 400, 255);
drawLamp(200, 400, 0);
drawLamp(700, 400, 0);
drawLamp(850, 400, 255); //bottom 4
drawLamp(50, 250, 0);
drawLamp(200, 250, 255);
drawLamp(700, 250, 255);
drawLamp(850, 250, 0); //middle 4
drawLamp(50, 100, 255);
drawLamp(200, 100, 0);
drawLamp(700, 100, 0);
drawLamp(850, 100, 255); //top 4

}

function drawMoon(x, y, diameter, r, g, b) {
fill(r, g, b);
ellipse(x, y, diameter, diameter); //moon
}
function drawLamp(x, y, clr) {
fill(clr);
rect(x + 40, y + 50, 20, 400); //tube
rect(x, y, 100, 100); //shade
rect(x + 25, 550, 50, 50); //base
}

function star(x, y, radius1, radius2, npoints) {
var angle = TWO_PI / npoints;
var halfAngle = angle / 2.0;
beginShape();
for (var a = 0; a < TWO_PI; a += angle) {
var sx = x + cos(a) * radius2;
var sy = y + sin(a) * radius2;
vertex(sx, sy);
sx = x + cos(a + halfAngle) * radius1;
sy = y + sin(a + halfAngle) * radius1;
vertex(sx, sy);
}
endShape(CLOSE);
}

PCOMP week 4 – I can see the light.

PCOMPweek4slide1Screen Shot 2015-09-29 at 10.34.20 PMPCOMPweek4slide

It’s all about syntax. This week I worked on learning the language – it is the fuel to make our machines go.  It has been hard for me melt the walls of the physical and digital work flow that exists in my brain. With ICM it is an easier, more linear process of de-bugging – Physical Computing can leave you feeling out in the cold. With both ICM and PCOMP there are an infinite amount of reasons why something will not work, but there is something different about looking down at that breadboard and thinking about the current flowing through it. I feel on track now – the more I play with you, Arduino, the better I get to know you.

another Look at some Objects, Functions, and now – rotation.

var moon = {
x: 500,
y: 650,
display: function() {
stroke(0);
strokeWeight(13);
ellipse(this.x, this.y, 300, 300);
},
move: function(){
this.x = this.x + random(-.2, .2);
this.y = this.y + random(-.2, .2);
}
}

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

function draw() {
background(255, 174, 185);
text(mouseX, 10, 20);
text(mouseY, 20, 30);
stroke(255, 204, 0);
strokeWeight(5);
fill(238, 229, 222);
quad(-5, 945, 490, 255, 510, 255, 1005, 945); //road

stroke(255, 204, 0);
strokeWeight(7);
drawMoon(500, 110, 300, 0, 0, 255); //centermoon

moon.move();
moon.display();

push(); //centerstar
translate(500, 110);
rotate(frameCount / 90.0); //frame
star(0, 0, 80, 100, 40);
pop();
stroke(255, 204, 0);
strokeWeight(7);

drawMoon(100, 110, 300, 255, 0, 0);

push(); //leftstar
translate(100, 110);
rotate(frameCount / 90.0);
star(0, 0, 80, 100, 40);
pop();

drawMoon(900, 110, 300);

push(); //rightstar
translate(900, 110);
rotate(frameCount / 90.0);
star(0, 0, 80, 100, 40);
pop();

drawMoon(300, 90, 100);
drawMoon(700, 90, 100);
drawMoon(100, 110, 100);
drawMoon(900, 110, 100);

drawLamp(50, 400, 255);
drawLamp(200, 400, 0);
drawLamp(700, 400, 0);
drawLamp(850, 400, 255); //bottom 4
drawLamp(50, 250, 0);
drawLamp(200, 250, 255);
drawLamp(700, 250, 255);
drawLamp(850, 250, 0); //middle 4
drawLamp(50, 100, 255);
drawLamp(200, 100, 0);
drawLamp(700, 100, 0);
drawLamp(850, 100, 255); //top 4

}

function drawMoon(x, y, diameter, r, g, b) {
fill(r, g, b);
ellipse(x, y, diameter, diameter); //moon
}
function drawLamp(x, y, clr) {
fill(clr);
rect(x + 40, y + 50, 20, 400); //tube
rect(x, y, 100, 100); //shade
rect(x + 25, 550, 50, 50); //base
}

function star(x, y, radius1, radius2, npoints) {
var angle = TWO_PI / npoints;
var halfAngle = angle / 2.0;
beginShape();
for (var a = 0; a < TWO_PI; a += angle) {
var sx = x + cos(a) * radius2;
var sy = y + sin(a) * radius2;
vertex(sx, sy);
sx = x + cos(a + halfAngle) * radius1;
sy = y + sin(a + halfAngle) * radius1;
vertex(sx, sy);
}
endShape(CLOSE);
}

ICM Sept 26

function setup() {
createCanvas(800, 650);
}

function draw() {
background(0);
drawLamp(100, 100, 550);
drawLamp(250, 100, 550);
drawLamp(400, 100, 550);
drawLamp(550, 100, 550);
}
function drawLamp(x, y, baseY) { //parameters
var shadewidth = 100;
stroke(30);
rect(x + 40, y + 50, 20, 400); //tube
rect(x, y, 100, 100); //shade
rect(x + 25, baseY, 50, 50); //base
this.update = function() { //when the mouse is inside the lampshade the background goes to yellow
if (mouseX > x && mouseX < (x + shadewidth) && mouseY > y && mouseY < y + shadewidth) {
rect(10, 10, 10, 10);

}

}
}

ICM WEEK 3: I HAD ABOUT 1000 IDEAS.

It is true that you must learn to walk before you run. However, what I have been learning in ITP has required myself to slow down, take a deep breath and start my journey  by squirming on the ground like much like an aimless yet relaxed worm.  Last week I felt the wind in my sails leading up to my Wednesday marathon of mental exercise that is both ICM and PCOMP back to back. This week, I was getting chopped down as my ideas grew larger and faster but my skills trailed behind slowly, but importantly, steadily.

I will say that I am happy on the ground moving like an embryo in the swamp that is java script. I have learned to like it down here. I feel comfortable and warm and protected. However, I know that like any single celled organism – I have the potential for much growth.

Here is my sketch for this week:

An Organism With A Tooth

//background color
var r = 232
var g = 121
var b = 189
  //control box
var x = 100;
var y = 100;
var w = 100;
var h = 100;


//small rect
var xrect1 = 300;
var yrect1 = 200;
var wrect1 = 30;
var hrect1 = 30;

//rightsmallrect
var xrect2 = 700;
var yrect2 = 200;
var wrect2 = 30;
var hrect2 = 30;


//mouth
var xrect3 = 330;
var yrect3 = 300;
var wrect3 = 350;
var hrect3 = 10;

//fangleft
var fangx1 = 470;
var fangy1 = 303;
var fangx2 = 500;
var fangy2 = 360;
var fangx3 = 530;
var fangy3 = 303;

//fangright
var fangrx2 = 667;
var fangry2 = 303;
var fangrx2 = 600;
var fangry2 = 360;
var fangrx3 = 640;
var fangry3 = 303;


//top triangle 
var trix1 = 500;
var triy1 = 250;
var trix2 = 250;
var triy2 = 0;
var trix3 = 750;
var triy3 = 0



function setup() {
  createCanvas(1000, 500)

}

var goDown = false; //resident

function draw() {

  background(r, g, b);
  stroke(1);
  strokeWeight(5);
  fill(31, 255, 128);
  rect(75, 75, 150, 150);
  rect(x, y, w, h);


  //the mouse is inside the box
  if (mouseX >= x && mouseX <= (x + w) && mouseY >= y && mouseY <= (y + h)) {
    //when inside the box, x get bigger by 1
    x = x + 1;
    y = y + 1;

    //small rectangle
    rect(xrect1, yrect1, wrect1, hrect1);

    xrect1 = xrect1 + 1;
    yrect1 = yrect1 + 1;

    //small rectangle right
    rect(xrect2, yrect2, wrect2, hrect2);
    xrect2 = xrect2 + 1;
    yrect2 = yrect2 + 1;

    //mouth
    rect(xrect3, yrect3, wrect3, wrect3);

    //triangle top
    triangle(trix1, triy1, trix2, triy2, trix3, triy3);

//fang
fill(255,0,0)
triangle(fangx1,fangy1,fangx2,fangy2,fangx3,fangy3);


    //residentcode
    if (r > 255) {
      goDown = true;

    }

    if (goDown === true) {
      r = r - 1
      g = g - 1
      b = b - 1
    } else {
      r = r + 1
      g = g + 1
      b = b + 1
    }

    if (r < 0) {
      goDown = false;
    } //resident code


    if (xrect1 >= 302 && yrect1 >= 202) {
      xrect1 = xrect1 - 5;
      yrect1 = yrect1 - 5;

    }

  }
  //controlling amount that box is moving
  if (x >= 102 && y >= 102) {
    //when x equal to or great than 102, x = 97
    x = x - 5;
    y = y - 5;
  }

  if (xrect2 >= 702 && yrect2 >= 202) {
    xrect2 = xrect2 - 5;
  yrect2 = yrect2 - 5;
  }

}

PCOMP WEEK 3: Digital Wind Chime For Times When You Have No Wind

It’s nice to feel the power of potential in your hands. Using that potential energy feels good. Theses new projects are filled with possibility, within these new ideas new found energies. The elements can be anything – terra (earth), aqua (water), aer (air), and ignis (fire) – these are what we play with. I present to you my project – the making of an air reaction, the making of wind chimes with no wind: Digital Wind Chime For Times When You Have No Wind

IMG_1423 2IMG_1421.JPG 3