Advertisement
xeromino

addEffects

Jan 24th, 2015
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. PImage img;
  2.  
  3. void setup() {
  4.   img = loadImage("http://media-cache-ak0.pinimg.com/736x/2c/f6/a5/2cf6a58f75b368949cf98db03b925f1b.jpg");
  5.   size(img.width, img.height);  
  6.   image(img, 0, 0, width, height);
  7. }
  8.  
  9. void draw() {
  10. }
  11.  
  12. void mouseReleased() {
  13.   int num = (int) random(10, 50);
  14.   for (int i=-num/2; i<1+num/2; i++) {
  15.     float x = mouseX-i;
  16.     float y = mouseY;
  17.     color col = img.get(int(x), int(y));
  18.     stroke(col, 150);
  19.     line(x, y, x, y+int(random(100, 200)));
  20.   }
  21. }
  22.  
  23. void keyPressed() {
  24.   save(random(34344)+".jpg");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement