プログラミング初心者です。
processingで下のサイトのようなものを作りたいのですが、四角形の大きさや配置をバラバラにすることができません。
またそれに加えて、四角形の大きさを時間がたつにつれ大きくしたり、小さくしたり(四角形一つずつ動きが違う)ものにしたいです。
よろしくお願いします。
http://www.complexification.net/gallery/machines/boxFittingImg/index.php
processing
1PImage img; 2float mosaicSize = random(5,12); 3 4void setup() { 5 size(600, 400); 6 img = loadImage("photo.jpeg"); 7 image(img, 0, 0); 8 loadPixels(); 9 frameRate(5); 10} 11 12void draw() { 13 background(0); 14 for(int j = 0; j < height; j+=mosaicSize) { 15 for(int i = 0; i < width; i+=mosaicSize) { 16 color c = pixels[j * width + i]; 17 fill(c, 127); 18 rect(i, j, brightness(c)/6.0, brightness(c)/6.0); 19 } 20 } 21} 22 23 24
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。