Advertisement
xeromino

arcs

Nov 13th, 2014
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. PImage img;
  2. int step = 10, num=0, sz=20;
  3.  
  4. void setup() {
  5.   img=loadImage("http://media-cache-ec0.pinimg.com/736x/63/13/80/631380ba46df3bbd4ea0648a3c2d192f.jpg");
  6.   size(img.width, img.height);
  7.   background(0);
  8.   noStroke();
  9.   strokeCap(SQUARE);
  10.   strokeWeight(5);
  11.   //image(img,0,0);
  12.  
  13.   while (sz<width-10) {
  14.         num += 4;
  15.     for (int i=0; i<num; i++) {
  16.       noFill();
  17.       float slice = TWO_PI/num;
  18.       float slice2 = slice*.55;
  19.       float r =TWO_PI/num*i;
  20.       int x = int(width/2 + cos(r)*sz/2);
  21.       int y = int(height/2.4 + sin(r)*sz/2);
  22.       color c = img.get(x, y);
  23.       pushMatrix();
  24.       translate(width/2, height/2.4);
  25.       rotate(r);
  26.       stroke(c);
  27.       arc(0, 0, sz, sz, -slice2, slice2 );
  28.       popMatrix();
  29.     }
  30.  
  31.     sz += 15 ;
  32.   }
  33. }
  34.  
  35. void drawPoint(float x, float y, float noiseFactor, float offSet) {
  36.   float sz = noiseFactor*step;
  37.   color f = img.get(int(x), int(y));
  38.   fill(f, 100);
  39.   ellipse(x+offSet, y+offSet, sz, sz);
  40. }
  41.  
  42. void draw() {
  43. }
  44.  
  45. void keyPressed() {
  46.   save(random(23232)+".jpg");
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement