We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there, I'm trying to create an effect similar to flow by V5MT. My goal/approach right now is to isolate the pixel rows and translate them by a random number. But I'm not sure what exactly the syntax would be to do so.
Dont neccesarily need to achieve the cascading image roll effect. Im trying to just do it with one static image first then maybe will tackle the motion issue.
thanks!
PImage img;
void setup() {
size(375,500);
img = loadImage("bust.jpg");
background(0);
loadPixels();
for ( int x = 0; x < width; x++ ) {
for ( int y = 0; y < height; y++) {
int loc = x + y * width;
color c = img.pixels[loc];
pushMatrix();
translate(x+random(10),y);
fill(c);
noStroke();
rect(0,0,1,1);
popMatrix();
}
}
}
Answers
Hi. Translating is slow for this purpose. A shader would do this very fast. Without shaders, maybe something like this?