2009年3月30日 星期一

數位美學 3/30

//奇怪的結果....

PImage a; // Declare variable "a" of type
PImagint b;
void setup()
{
size(700, 525);
frameRate(60); // The file "jelly.jpg" must be in the data folder
// of the current sketch to load successfully
a = loadImage("c:\\test1.jpg"); // Load the image into the program
//noLoop(); // Makes draw() only run once
noStroke();
}

void draw() { // Displays the image at its actual size at point (0,0)
tint(200, 15);
image(a, 0, 0); // Displays the image at point (100, 0) at half of its size
tint(50, 255);
image(a, 315, 0, 50, 220);
b= (b+ 1)%(width+32);
stroke(226, 204, 0);
line(0, b ,width, b-26); line(0, b-6, width, b-32);
float pointillize = map(mouseX, 0, width, 2, 100);
int x = int(random(a.width));
int y = int(random(a.height));
color pix = a.get(x, y);
tint(255, 255);
fill(pix, 126);
ellipse(x, y, pointillize, pointillize);
}


//會變透明是因為背景圖每次DRAW都畫一次
//要放在SETUP


//----------蒙太奇
PImage a;
PImage b;
void setup(){
a = loadImage("c:\\test1.jpg");
b = loadImage("c:\\test2.jpg");
size(700,525);
noStroke();
background(255);
smooth();
image(a,0,0);
}

void draw(){
float pointillize = map(mouseX, 0, width, 2, 30);
int x = int(random(a.width));
int y = int(random(a.height));
color pix = a.get(x, y); //fill(pix, 126);
tint(pix);
image(b,x,y,pointillize,pointillize);
//ellipse(x, y, pointillize, pointillize);
}

沒有留言:

張貼留言