Aaron Lee – Final Project

sketch

/*
Aaron Lee
Section C
sangwon2@andrew.cmu.edu
Final Project
*/

var canvaswidth = 640;
var canvasheight = 480;

var myCaptureDevice;
var brightnessThreshold = 50;
var darknessThreshold = 45;
var theBrightnessOfTheColorAtPxPy = 100;
var px = 30;
var py = 30;

var gamelogo;
var spacefighter;
var invader = [];
var missile = [];
var score = 0;

var img_Invader, img_spacefighter, img_Missile,img_background;


function setup() {//creating camera for the background
   createCanvas(canvaswidth, canvasheight);
   myCaptureDevice = createCapture(VIDEO);
   myCaptureDevice.size(canvaswidth, canvasheight); // attempt to size the camera. 
   myCaptureDevice.hide(); // this hides an unnecessary extra view.
   
}

function preload(){ //preloading the reference images
    img_Invader = loadImage("https://i.imgur.com/hBZOUxR.png");
    img_spacefighter = loadImage("https://i.imgur.com/wJPVqdo.png");
    img_Missile = loadImage("https://i.imgur.com/0O0UGN4.png");
    gamelogo = loadImage("https://i.imgur.com/hBZOUxR.png");
}

spacefighter = {
    x : 140,
    width : 30,
    y : 400,
    height: 30,
    draw : function() {
        image(img_spacefighter, this.x, this.y, this.width, this.height);
    }
}

//--------------------------------------//invader
function Invader(I) {
    I.active = true;
    I.x =random(640);
    I.y = 0;
    I.width = 50;
    I.height = 50;
    I.speed = 2;
    I.inBounds = function(){
        return I.x >= 0 & I.y >= 0 && I.x < canvaswidth - I.width && I.y < canvasheight - I.height;
    }
    I.draw = function(){
        image(img_Invader, I.x, I.y, I.width, I.height);
    }
    I.update = function(){
        I.active = I.active & I.inBounds();
        I.y += I.speed;
    }
    return I;

    function trlUpdate() { //this is the part where the code unfortunately doesn't work
   //fetch the color of the pixel at the (px,py)
   var theColorAtPxPy = myCaptureDevice.get(this.px, this.py);
   //compute its birghtness
   theBrightnessOfTheColorAtPxPy = brightness(theColorAtPxPy);
   //if the textrainletter is in a bright area, move downwards
   if (theBrightnessOfTheColorAtPxPy > brightnessThreshold) {
   this.py++;
   }
   //else if it's in a dark area, move up until we're in a light area
   while (theBrightnessOfTheColorAtPxPy < darknessThreshold & py > 0) {
     theColorAtPxPy = myCaptureDevice.get(px, py)
     theBrightnessOfTheColorAtPxPy = brightness(theColorAtPxPy);
     this.py--;  
   }
   //reset to initial place if falls off the screen
   if (this.py >= height) {
   this.py = 0;
   }
}
}

//--------------------------------------//missile
function Missile(I){
    I.active = true;
    I.x = spacefighter.x;//because both the missile and spacefighter share same origin
    I.y = spacefighter.y;
    I.width = 30;
    I.height = 30;
    I.speed = 10;
    I.inBounds = function(){
        return I.x >= 0 & I.y >= 0 && I.x < canvaswidth - I.width && I.y < canvasheight -  I.height;
    }
    I.update = function(){
        I.active  = I.active & I.inBounds();
        I.y -= I.speed;
    }
    I.draw = function(){
        image(img_Missile, I.x, I.y, I.width, I.height);
    }
    return I;
}


//--------------------------------------//shooting
function shooting(Invader, Missile){
    return Missile.x + Missile.width >= Invader.x & Missile.x < Invader.x + Invader.width &&
            Missile.y + Missile.height >= Invader.y && Missile.y < Invader.y + Invader.height;
}

function draw(){
    clear();
    myCaptureDevice.loadPixels();
   image(myCaptureDevice, 0,0);
   image(gamelogo, 30, 30);
    fill("red");
    textStyle(BOLD);
    textFont('Sprint2');
    textSize(20);
    text("HIGH SCORE : " + score, canvaswidth / 2 - 80, 20);
    if(keyIsDown(LEFT_ARROW)){              //left key configuration
        if(spacefighter.x - 3 >= 0)
            spacefighter.x -= 3;
        else
            spacefighter.x = 0;
    }
    if(keyIsDown(RIGHT_ARROW)){              //right key configuration
        if(spacefighter.x + 3 <= canvaswidth-spacefighter.width)
            spacefighter.x += 3;
        else
            spacefighter.x = canvaswidth - spacefighter.width;
    }
    if(keyIsDown(UP_ARROW)){              //up key configuration
        if(spacefighter.y - 5 >= 0)
            spacefighter.y -= 5;
        else
            spacefighter.y = 0;
    }
    if(keyIsDown(DOWN_ARROW)){              //down key configuration
        if(spacefighter.y + 5 <= canvasheight-spacefighter.height)
            spacefighter.y += 5;
        else
            spacefighter.y = canvasheight - spacefighter.height;
    }
    if(keyIsDown(32)){
        missile.push(Missile({}));
    }
    spacefighter.draw();              //draw spacefighter
    missile.forEach(function(Missile){//draw and update the missiles
        Missile.update();
        Missile.draw();
    });

    if(Math.random()<0.07){
        invader.push(Invader({}));
    }
    invader = invader.filter(function(Invader){
        return Invader.active;
    });
    invader.forEach(function(Invader){
        Invader.update();
        Invader.draw();
    });

    missile.forEach(function(Missile){
        invader.forEach(function(Invader){
            if(shooting(Invader, Missile)){
                Invader.active = false;
                Missile.active = false;
                score++;
            }
        });
    });

    invader.forEach(function(Invader){
        if(shooting(Invader, spacefighter)){
            Invader.active = false;
            noLoop();
            textStyle(BOLD);
            textFont('Sprint2');
            textSize(40);
            fill("red");
            text("continue? press f5", width / 2 - 160, height /2);
        }
    });
}

Instruction: 1) please allow camera access 2) you are a space fighter on an important mission. Use arrows keys for maneuver, and space bar to terminate space invaders 3) player who gets the higher score wins

*what didn’t work: 1)the pixels of the player in the background were supposed to buffer the velocity of the space invaders 2)the camera notification setting distracts the player in the beginning when the page is refreshed

I personally had lot of fun making this game as it really provoked my child experience with retro arcade games. I wanted to be selective in use of color, font and art in order to mimic the retro feelings.

Aaron Lee – Looking Outwards 12

It is obvious that out of the two inspirational precursors, Galaga developed by Namco is the first precedent. Because both the narrative and the interface of my game largely comes from the original Galaga, I would like to capture that reminiscence when I first encountered this game as a little boy back in 90s.

Galaga by Namco, 1981

Another precedent is Justdance by Ubisoft. Released exclusively for Wii, this game uses the camera sensor to detect player’s dance move. Although my game doesn’t require player to dance, because I will be using interactive camera to affect the gameplay, l think this will be a nice inspiration. As I mentioned in my proposal, the speed of falling space debris will be buffered by the player captured in camera triggered by its pixel brightness.

Justdance by Ubisoft, 2009

Aaron Lee – Project 12 – Proposal

For the final project, I would like to recreate Galaga, the legendary shooter arcade game developed by Namco. Galaga was literally the first video game that I played when I was a little boy. This project will be a nice way to commemorate my memories.

The narrative of the game is… the space fighter is sent on a mission to clear space debris created by mindless human race. The player of the game will navigate using arrow keys and spacebar to dodge and shoot space debris. The space debris will randomly move from the top of the canvas and downward. The HP bar will go down when hit by the debris. The score will accumulate when the player successfully shoots the debris. The game will end when you have no more health left.

In order to differentiate from the original game, I would like to add special feature, which is to introduce interactive camera in background of the game. Triggered by the brightness of the pixels, the speed of falling space debris will be buffered by the dark pixels. This means the location of the player displayed in the background will affect the success of the play.

Aaron Lee – Project 11 – Landscape

sketch

/*
Aaron Lee
Section C
sangwon2@andrew.cmu.edu
Project-11-Generative Landscape
*/

var stars = [];

function setup() {
    createCanvas(400,600);
    
    for (var i = 0; i < 15; i ++) {                      //initial placement of stars
        var starsX = random(width);
        var starsY = random(height);
        stars[i] = makestars(starsX, starsY);
    }
    frameRate(10);
}

function draw() {
    background("black");

    showstars();
    deletestars();
    makeNewstars();
    spaceship();
}

//----------------------------------------stars--------------------------------------------------
function showstars() {                                      //this makes the stars move down
    for(var i = 0; i < stars.length; i++) {
        stars[i].move();
        stars[i].display();
    }
}

function deletestars() {                                    //deletes stars that disappear from sight
    var starsToKeep = [];
    for (var i = 0; i < stars.length; i++) {
        if(stars[i].y > 600) {
            starsToKeep.push(stars[i]);
        }
    }
}

function makeNewstars() {                                   //creates more stars coming down
    var newstarsLiklihood =0.05
    if (random(0,1) < newstarsLiklihood) {
        stars.push(makestars(random(width), 0));
    }
}

function starsMove() {                                      //sets the move property of stars
    this.y += this.speed;
}

function starsDisplay() {                                   //what stars look like
    var starsSize = this.starsSize;
    fill("#FFFF00");
    noStroke();
    push();
    translate(this.x, this.y);
    rotate(frameCount / 200.0);
    star(0, 0, 5, 10, 5);
    pop();
}

function star(x, y, radius1, radius2, npoints) {
   let angle = TWO_PI / npoints;
   let halfAngle = angle / 2.0;
   beginShape();
   for (let a = 0; a < TWO_PI; a += angle) {
     let sx = x + cos(a) * radius2;
     let 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);
}

function makestars(birthLocationX, birthLocationY) {       //function that makes the stars
    var stars = {x : birthLocationX,                                  //stars are born in random places
                y : birthLocationY, 
                speed : random(1, 5),                                //sets random speed of stars
                starsSize : random(10, 25),                          //sets random size of stars
                move : starsMove,  
                display : starsDisplay}
                return stars;
}


//----------------------------------------spaceship--------------------------------------------------
function spaceship() {                                 //function makes the spaceship window frame
    fill("#C0C0C0");
    strokeWeight(5);
    stroke("black");

    beginShape();
    vertex(0, 600);
    vertex(0, 520);
    vertex(400, 520);
    vertex(400, 600);
    endShape(CLOSE);

    beginShape();
    vertex(0, 80);
    vertex(0, 0);
    vertex(400, 0);
    vertex(400,80);
    endShape(CLOSE);
               
    beginShape();
    vertex(0, 0);
    vertex(80, 0);
    vertex(80, 600);
    vertex(0, 600);
    endShape(CLOSE);

    beginShape();
    vertex(320, 0);
    vertex(400, 0);
    vertex(400, 600);
    vertex(320, 600);
    endShape(CLOSE);

    fill("#808080");
    ellipse(120, 40, 30, 30);
    ellipse(200, 40, 30, 30);
    ellipse(280, 40, 30, 30);
    ellipse(120, 560, 30, 30);
    ellipse(200, 560, 30, 30);
    ellipse(280, 560, 30, 30);
}

When I first thought of the generative landscape, I associated with the infinite and the random arrangement of the stars in galaxy. Then I came up with a narrative that a spaceman is observing stars inside the spaceship. Overall I used monotone for the spaceship in order to give focus to the stars

Aaron Lee – Looking Outwards – 11

Toni Doves is a media artist active in New York who uses motion sensing for her film, installation and performance. For example, in her exhibition, participants would see their avatars on screen that emulate motions.

One of her prominent projects, ‘The dress that eats soul’, already gives a powerful presence without further explanation by its appearance. A huge mechanical female sculpture in front of movie screen emits different lights and effects that follows to the narrative.

According to artist’s description, the sculpture’s dress is triggered by the movement of the participant and starts to play video and tell a story. The projection on the overheads follows the direction of the participant’s head to enhance virtual reality. The video is dubbed with poem scripted by novelist Rene Steinke. Each video is unique and responsive to the participant’s movement.

The main reason I picked this artist is mainly due to my passion in cinema which Doves has a serious connection to. I was curious to find what aesthetic and technological impact one could bring to the art of cinema. It was also interesting how she was using responsive features of her work to address and develop personal connections to the participants.

Artist’s website: https://tonidove.com/

The dress that eats soul by Toni Doves, (watch from 22:00 and onward)

Aaron Lee – Looking Outwards 10

“I am using 1 of my grace days for this late submission.”

Anders Lind is a great Swedish artist who actively uses computation to compose and perform music. Also a creative director at the Umea University, he composes music mainly for orchestras, choirs, and various ensembles and solo performers.

For this blog post, I was mainly interested in his 2016 exhibition, Lines, which brings musical experience to the field of electronics or interactive technology. In this experimental exhibition, the lines are attached to either wall, floor or hung to ceiling with sensors that create pitch of sound when interrupted by human body. The scale of the exhibition also encourages the visitor to be creative about music making and corporate with others to create musical harmony.

No musical background is required to enjoy the program. The video also shows different group of people interacting, including children.

LINES, 2016, Västerbotttens Museum

Aaron Lee – Project 10 – Sonic Sketch

sketch

/*
Aaron Lee
Section C
sangwon2@andrew.cmu.edu
Project-10-Sonic Sketch
*/

var angry;
var happy;
var puzzled;
var sad;

function preload() {
    // call loadImage() and loadSound() for all media files here
    angry = loadSound("https://courses.ideate.cmu.edu/15-104/f2019/wp-content/uploads/2019/11/angry-1.wav");
    happy = loadSound("https://courses.ideate.cmu.edu/15-104/f2019/wp-content/uploads/2019/11/happy.wav");
    puzzled = loadSound("https://courses.ideate.cmu.edu/15-104/f2019/wp-content/uploads/2019/11/puzzled.wav");
    sad = loadSound("https://courses.ideate.cmu.edu/15-104/f2019/wp-content/uploads/2019/11/sad.wav");

}


function setup() {
    // you can change the next 2 lines:
    createCanvas(400, 100);
    background(255);
    //======== call the following to use sound =========
    useSound();
}


function soundSetup() { // setup for audio generation
    // you can replace any of this with your own audio code:
    angry.setVolume(1);
    happy.setVolume(2);
    puzzled.setVolume(1);
    sad.setVolume(1);

}


function draw() {
    background(255);
    //angry
    fill("red");
    rect(0, 0, 100, 100);
    fill("black");
    arc(20, 30, 10, 10, 0, PI);
    arc(80, 30, 10, 10, 0, PI);
    line(25, 80, 75, 80);
    //happy
    fill("yellow");
    rect(100, 0, 100, 100);
    fill("black");
    ellipse(120, 30, 10, 10);
    ellipse(180, 30, 10, 10);
    arc(150, 50, 80, 80, 0, PI);
    //puzzled
    fill("green");
    rect(200, 0, 100, 100);
    fill("black");
    ellipse(220, 30, 10, 10);
    ellipse(280, 30, 10, 10);
    ellipse(250, 80, 10, 10);
    //sad
    fill("blue");
    rect(300, 0, 100, 100);
    fill("black");
    line(315, 30, 325, 30);
    line(375, 30, 385, 30);
    arc(350, 90, 80, 80, PI, 0);
}

function mousePressed() {
    //setting mousepresed location
    if (mouseX > 0 & mouseX < 100 ) {
        angry.play();
        } else {
        angry.pause();
        }
    if (mouseX > 100 & mouseX < 200) {
        happy.play();
        } else {
        happy.pause();
        }
    if (mouseX > 200 & mouseX < 300) {
        puzzled.play();
        } else {
        puzzled.pause();
        }
    if (mouseX > 300 & mouseX < width) {
        sad.play();
        } else {
        sad.pause();
        }
}

In this project, I created 4 different emojis: angry, happy, puzzled and sad. The associated sound plays when the mouse is pressed.

Aaron Lee-Looking Outwards-09

For this week’s looking outward post, I decided to find inspiration from CJ’s post on computational fabrication. Although I do not know CJ personally, this post about the design studio called Nervous System looked very interesting to me.

While generative design system is pretty much ubiquitous these days including architecture field, finding a form making specifically inspired by flowers was interesting to me. When I visited the studio’s website, I was drawn to their past project, especially the kinematic clothing.

Commissioned by the Museum of Fine Arts Boston, the project shows how digital fabrication is not limited to only certain field. The interconnected system of tessellated triangular panels adjusts accordingly to the user’s posture. Emerged from 3d printer fully assembled, the project perhaps shows the glimpse of next generation of customized production.

Original LO post: https://courses.ideate.cmu.edu/15-104/f2019/2019/09/14/cj-walsh-looking-outward-03-computational-fabrication/

Creator’s website: https://n-e-r-v-o-u-s.com/projects/tags/3dprint/albums/kinematic-petals-dress/

by nervous system in 2016

Aaron Lee-Project-09- Portrait


sketch

/*
Aaron Lee
Section C
sangwon2@andrew.cmu.edu
Project-09-Computational Portrait
*/
         
var theImage

function preload() {
   var imageLocation = "https://i.imgur.com/OVTGqnb.jpg"; //preload the theImage from link
   theImage = loadImage(imageLocation);
}

function setup() {
   createCanvas(240, 260);
   background(0);
   theImage.loadPixels();
   frameRate(1000);
   colorMode(RGB);
}

function draw() {
   var pixelX = random(0, width); //random x coordinate of a pixel
   var pixelY = random(0, height); //random y coordinate of a pixel
   var iX = constrain(floor(pixelX), 0, width - 1);
   var iY = constrain(floor(pixelY), 0, height - 1);
   var pixelColor = theImage.get(iX, iY);//getting color info for rectangle fill
   var rectLength = map(brightness(pixelColor), 0, 50, 0, 10);
   var imageatthemouse = theImage.get(mouseX, mouseY); //pixel at the mouse position

   fill(pixelColor);
   rectMode(CENTER);
   rect(pixelX, pixelY, 4, rectLength);
   noFill();
   stroke(imageatthemouse);
   rect(pmouseX, pmouseY, 10, 10);
}

I chose a portrait of myself with high frame rate in order to see quick change. The rectangles with random size and appropriate stroke give a balanced finished look at the end. The portrait is also user interactive with mouse that creates hollow rectangles.

Aaron Lee – Looking Outwards 08

Michael Szivos of SOFTlab

Michael Szivos of SOFTlab is an architect based in New York City, which alone gives me an enough reason to review his talk as an architecture student. Michael created this design studio shortly after graduating from the Graduate School of Architecture, Planning and Preservation at Columbia University. Despite the fact that he described himself as an outsider of architecture world, it is quite surprising to find what many architecture firms today do in practice seems similar to SOFTlab’s work in the past.

At first glance, SOFTlab’s main body of work largely contemplates about the process of fabrication that support the design idea. However, this studio really governs both the initial design and the fabrication process. Many of their works have been successful and were selected by different publications and exhibitions including MoMa, The Met and The New York Times. One of their projects that I found inspiring was from Mobile World Congress 2017 at Barcelona. This large-scale installation of roof structure was designed for IBM booth promoting Watson. For this project, SOFTlab got its design motif from Antonio Gaudi, the legendary Spanish Architect. The beautiful cladding of aluminum petal like panels glow in different colors to as to show the glimpse of future technology of IBM. It was also interesting to watch beside from coding, many of the digital tools they were using overlapped to that of mine in school.

The way Michael Szivos presents is actually very interesting. Because he digressed from being traditional architect, he starts the presentation by comparing his firm to the fields using movie reference. This whimsical self-introduction gave me a better understating to picture about their practice furthermore.

The attached video is another project by SOFTlab called Iris – an array of responsive mirrors with LEDs that rotate in response to people’s movement.

The attached video is another project by SOFTlab called Iris – an array of responsive mirrors with LEDs that rotate in response to people’s movement.

website: https://softlabnyc.com/