Advertisement
xeromino

vortex

Sep 22nd, 2015
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. PImage img;
  2. float angle, radius, theta;
  3. int frms = 20;
  4.  
  5. void setup() {
  6.   size(540, 540);
  7.   //img = loadImage("http://emoji.ink/assets/160x160/407.png"); 407,483,193,189,257
  8.   img = loadImage("http://emoji.ink/assets/160x160/483.png");
  9.   background(0);
  10. }
  11.  
  12. void draw() {
  13.   background(0);
  14.   radius = 0;
  15.   angle =0;
  16.   while (radius<width/1) {
  17.     PImage tmp = img.copy();
  18.     float x = width/2 + cos(angle+theta)*radius;
  19.     float y = height/2 + sin(angle+theta)*radius;
  20.     angle += 0.5 ;
  21.     radius += 1;
  22.     int rs = (int) map(radius, 0, width/2, 10, 50);
  23.     tmp.resize(rs, rs);
  24.     image(tmp, x, y);
  25.     if (radius%200==0) filter(BLUR, 0.6);
  26.   }
  27.   theta += TWO_PI/frms;
  28.   filter(GRAY);
  29.   //if (frameCount<=frms) saveFrame("image-###.gif");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement