
tex/tspをfileから読めるようにした時に出て来た人。横山裕一みたい。
minim用に書き直したやつとか何となく考えてる方向だとDasherみたいな入力方式が面白いのかも。
Inference Group: Dasher Project: Home
abstract class Animation {
void setup() {
background(255);
}
abstract void draw();
}
class Opening extends Animation {
int i=0;
void draw() {
background(255);
if(i>width) {
i=0;
}
line(i, 0, i, height);
i++;
}
}
class Middle extends Animation {
int i=0;
void draw() {
background(255);
if(i>height) {
i=0;
}
line(0, i, width, i);
i++;
}
}
class Ending extends Animation {
void draw() {
background(random(255));
}
}
Animation myAnimation;
void setup() {
myAnimation = new Opening();
}
void draw() {
myAnimation.draw();
}
void keyPressed() {
switch(key) {
case 'a':
myAnimation = new Opening();
break;
case 'b':
myAnimation = new Middle();
break;
case 'c':
myAnimation = new Ending();
break;
}
}
from urllib import *
page = urlopen('http://www.google.com/')
data = page.read()
size(400, 800)
fontsize(9)
path = textpath(data, 0, 10, WIDTH)
points = []
for point in path:
if point.cmd == CURVETO:
point.ctrl2.x += 5
point.ctrl2.y -= 10
point.y += 5
points.append(point)
drawpath(points)
page.close()
import processing.video.*;
Movie video;
int movieWidth = 160;
int movieHeight = 120;
int buffer[];
int moviePixels;
int srcPos;
int dstPos;
int bufferIndex;
int copyLength;
void setup() {
size(400, 200);
// also try with other video sizes
video = new Movie(this, "station.mov");
video.loop();
moviePixels = movieWidth * movieHeight;
buffer = new int[width*height];
background(0);
frameRate(24);
}
void draw() {
srcPos = int(random(moviePixels));
dstPos = int(random(width*height));
copyLength = width*height-dstPos;
video.read();
image(video, int(random(width)), int(random(height)), int(random(width)), int(random(height)));
loadPixels();
arraycopy(pixels, srcPos, buffer, 0, int(random(moviePixels)));
arraycopy(buffer, 0, pixels, dstPos, copyLength);
updatePixels();
if(keyPressed==true) {
saveFrame();
}
}