Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float noiseScale = 0.003;
- PImage image1;
- PImage image2;
- PImage image3;
- int iteration;
- void setup()
- {
- size(960, 540);
- image1 = loadImage("image1.png");
- image2 = loadImage("image2.png");
- image3 = loadImage("image3.png");
- iteration = 0;
- noiseSeed(10);
- }
- void draw()
- {
- loadPixels();
- for(int i = 0; i < width; i++)
- {
- for(int j = 0; j < height; j++)
- {
- float noiseValue1 = noise(i * noiseScale,j * noiseScale, iteration * 0.01);
- if(noiseValue1 < 0.46)
- pixels[i + j * width] = image1.pixels[i + j * width];
- if(noiseValue1 >= 0.46 && noiseValue1 < 0.55)
- pixels[i + j * width] = image2.pixels[i + j * width];
- if(noiseValue1 >= 0.55)
- pixels[i + j * width] = image3.pixels[i + j * width];
- }
- }
- updatePixels();
- iteration++;
- if(iteration < 900)
- {
- saveFrame("frames/frame-####.tif");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement