[ Video ]
[ About ]
ノイズで円の位置を動かしながら、半径を一番近い他の円との距離にしています。
Circles size is distance to the neighbor.
[ Source ]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
void setup(){ size(720, 720); frameRate(30); colorMode(HSB); strokeWeight(3); } void draw(){ background(239); randomSeed(39); translate(width / 2, height / 2); ArrayList<PVector> locations = new ArrayList<PVector>(); for(int i = 0; i < 50; i++) { float x = map(noise(random(1000), frameCount * 0.0065), 0, 1, -500, 500); float y = map(noise(random(1000), frameCount * 0.0065), 0, 1, -500, 500); locations.add(new PVector(x, y)); } for(int i = 0; i < locations.size(); i++) { PVector location = locations.get(i); float min = width * height; for(int j = 0; j < locations.size(); j++) { if(i == j) continue; PVector other = locations.get(j); float distance = PVector.dist(location, other); if(distance < min) { min = distance; } } fill(random(255), 200, 255); ellipse(location.x, location.y, min, min); } } |