ProcessingClass_08_Random_亂數
Class Room in OpenProcessing
Random
size(300, 300); background(255); for (int i = 5; i < 300; i += 5) { line(0, i, 300, i); }
==============================================================================
size(300, 300); background(255); for (int i = 5; i < 300; i += 5) { line(random(100), i, random(200,300), i); }
==============================================================================
size(300, 300); background(255); float v = 0.0; float inc = 0.01; for (int i = 0; i < 300; i += 2) { float n = noise(v) * 300; line(0,i,n, i); v = v + inc; }
==============================================================================
size(300, 300); background(255); float v = 0.0; float inc = 0.01; for (int i = 0; i < 300; i += 2) { float n = noise(v) * 250; line(0,i,n, i); line(2 * n, i, 300, i); v = v + inc; }
==============================================================================
size(300, 300); background(255); float v = 0.0; float inc = 0.01; smooth(); for (int i = -50; i < 300; i += 5) { float n = noise(v) * 250; line(0,i,n,i); line(n, i, 1.25 * n, i + 30); line(1.25 * n, i + 30, 2 * n, i); line(2 * n, i, 300, i); v = v + inc; }
==============================================================================
size(300, 300); background(255); float v = 0.0; float inc = 0.01; smooth(); noFill(); for (int i = -50; i < 300; i += 5) { float n = noise(v) * 100; bezier(0,i,1.25 * n, i + 30, 1.25 * n, i + 30, 300, i); v = v + inc; }
==============================================================================
Interactive Link
int n = 300; void setup() { size(n,n); background(255); noFill(); } void draw() { bezier(random(n),random(n),random(n),random(n), random(n),random(n),random(n),random(n)); }
==============================================================================
Interactive Link
int n = 300; void setup() { size(n,n); background(255); noFill(); smooth(); frameRate(10); } void draw() { strokeWeight(random(1,6)); stroke(random(64,255),random(64,255),random(64,255)); bezier(random(n),random(n),random(n),random(n), random(n),random(n),random(n),random(n)); }
==============================================================================
Interactive Link
int n = 300; void setup() { size(n,n); background(255); smooth(); frameRate(5); } void draw() { float r = random(n); fill(random(255),random(255),random(255)); ellipse(random(n),random(n),r,r); }
==============================================================================
Interactive Link
int n = 300; void setup() { size(n,n); background(255); smooth(); frameRate(5); noStroke(); } void draw() { float x = random(n); fill(random(255),random(255),random(255),random(255)); ellipse(random(n),random(n),x,x); }
==============================================================================
size(300,300); smooth(); strokeWeight(10); stroke(0, 130); for (int i = 0; i <= 50; i ++) { line(0, random(300), 300, random(300)); }
==============================================================================
size(300,300); smooth(); strokeWeight(10); stroke(0, 130); for (int i = 0; i <= 50; i ++) { strokeWeight(random(10)); stroke(random(255)); line(0, random(300), 300, random(300)); }
==============================================================================
size(300,300); smooth(); strokeWeight(10); stroke(0, 130); for (int i = 0; i <= 50; i ++) { strokeWeight(random(20)); stroke(random(255), random(255), random(255)); line(0, random(300), 300, random(300)); }
==============================================================================
size(300,300); background(0); stroke(255, 60); for (int i = 0; i < 300; i++) { strokeWeight(random(10)); line(i-20, 300, i+0.5*random(100), 0); }
==============================================================================
size(300,300); background(0); stroke(255, 60); for (int i = 0; i < 300; i++) { strokeWeight(random(10)); line(i-20, 300, i+5*random(100), 0); }
==============================================================================
size(200,200); noStroke(); for (int i = 0; i < 200; i += 10) { for (int j = 0; j < 200; j += 10) { fill((i+j) * 0.7); rect(i, j, 10, 10); } }
==============================================================================
size(300,300); float xnoise = 0.0; float ynoise = 0.0; float inc = 0.015; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { float gray = noise(xnoise, ynoise) * 255; stroke(gray); point(x, y); xnoise = xnoise + inc; } xnoise = 0; ynoise = ynoise + inc; }
==============================================================================