Recitation 11 workshop by Yuru Chen

For this recitation I chose to go to the workshop for media manipulation. 

We were asked to pick a tv show/music video/entrance video and recreate it using images and videos from the web. So what I did for this exercise is that I chose the Marvel opening sequence video as the original background video, and then if I press the mouse the video will change to an image of Game of Thorns which consists of pixels changing with the position of the mouse.  

Here is the demo of my exercise:

Processing Code:

import processing.video.*;
PImage photo;
Movie myMovie;

void setup() {
size(480, 270);
myMovie = new Movie(this, “marvel.mp4”);
myMovie.play();
photo = loadImage(“GOT2.jpg”);

}
void draw() {

if (mousePressed){
image(photo, 0, 0);
int rectSize = 5;
int w = photo.width;
int h = photo.height;
photo.loadPixels();
for(int y = 0; y < h; y=y+rectSize){
for(int x = 0; x < w; x=x+rectSize) {
int i=x+y*w;
fill(photo.pixels[i]);
ellipse(x,y,rectSize,rectSize);
int index = (y*photo.width)+x;
fill(photo.pixels[index]);

float d = dist(x, y, mouseX, mouseY);//you can change the mouseX, mouseY to the value from arduino
d = map(d, 0, sqrt(width*width+height*height), 1, rectSize*2);
float angle = map(d, 1, rectSize*2, 0, PI);
pushMatrix();
translate(x, y);
rotate(angle);

rect(0, 0, d, 3*d );
popMatrix();
}
}

}else{
if (myMovie.available()) {
myMovie.read();
}
image(myMovie, 0, 0);
}
}

Leave a Reply