HOME | About | Gallery Index | Site Map | E-Mail
日付 | 上が新しく、下が古い。 | |
---|---|---|
2022(R04)-02-11(金・祝) |
|
|
2018(H30)-04-01(日) | なんか、dx2, dy2 が、関数 title を呼んだら、書き換えられていたので、手こずった。その割には、あまり面白くない絵。 | OpenProcessing Prog.7
th = 0; function setup() { createCanvas(windowWidth, windowHeight); background(100); // fill(0); rect( windowHeight,0, windowWidth, windowHeight ); // } function tile( lv, right, top, dx, dy ) { if (lv < 1) { //rect( right, top, dx, dy ); } else { dx2 = dx / 2; dy2 = dy / 2; rect( right, top, dx2, dy2 ); rect( right+dx2, top+dy2, dx2, dy2 ); tile( lv-1, right+dx2, top, dx2, dy2 ); dx2 = dx / 2; dy2 = dy / 2; tile( lv-1, right, top+dy2, dx2, dy2 ); } } function draw() { th = th + 0.1 fill( ( sin( th )+1 )*256/2 ); mx = mouseX; my = mouseY; lv = 4; tile( lv, 0, 0, mx, my ); tile( lv, mx, my, windowHeight-mx, windowHeight-my ); } |
2018(H30)-03-23(金) | 1/f ゆらぎ | OpenProcessing Prog.6
function setup() { createCanvas(windowWidth, windowHeight); background(100); // fill(0); rect( windowHeight,0, windowWidth, windowHeight ); // rr = 164; x=0; while( x < windowHeight ) { line(x,0,x,windowHeight); x = x + rr/random(1,rr); } } function draw() { fill(128/random(128)+128); r = 64/random(1,64); ellipse(mouseX, mouseY, r, r); } |
2018(H30)-03-21(水・祝) |
|
OpenProcessing Prog.5(Prog.4 は欠番)
th = 0; Hilbert_x = 0; Hilbert_y = 0; Hilbert_delta = 10; oldX = 0; oldY = 0; // // // function ldr(n) { if (n > 0) { dlu(n - 1); Hilbert_x -= Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //← oldX = Hilbert_x; oldY = Hilbert_y; ldr(n - 1); Hilbert_y += Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //↓ oldX = Hilbert_x; oldY = Hilbert_y; ldr(n - 1); Hilbert_x += Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //→ oldX = Hilbert_x; oldY = Hilbert_y; urd(n - 1); } } function urd(n) { if (n > 0) { rul(n - 1); Hilbert_y -= Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //↑ oldX = Hilbert_x; oldY = Hilbert_y; urd(n - 1); Hilbert_x += Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //→ oldX = Hilbert_x; oldY = Hilbert_y; urd(n - 1); Hilbert_y += Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //↓ oldX = Hilbert_x; oldY = Hilbert_y; ldr(n - 1); } } function rul(n) { if (n > 0) { urd(n - 1); Hilbert_x += Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //→ oldX = Hilbert_x; oldY = Hilbert_y; rul(n - 1); Hilbert_y -= Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //↑ oldX = Hilbert_x; oldY = Hilbert_y; rul(n - 1); Hilbert_x -= Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //← oldX = Hilbert_x; oldY = Hilbert_y; dlu(n - 1); } } function dlu(n) { if (n > 0) { ldr(n - 1); Hilbert_y += Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //↓ oldX = Hilbert_x; oldY = Hilbert_y; dlu(n - 1); Hilbert_x -= Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //← oldX = Hilbert_x; oldY = Hilbert_y; dlu(n - 1); Hilbert_y -= Hilbert_delta; line(oldX, oldY, Hilbert_x, Hilbert_y); //↑ oldX = Hilbert_x; oldY = Hilbert_y; rul(n - 1); } } function HilbertCurve(n) { Hilbert_x = windowWidth/2 - 10; Hilbert_y = 10; Hilbert_delta = 26; oldX = Hilbert_x; oldY = Hilbert_y; ldr(n); } // // // function setup() { createCanvas(windowWidth, windowHeight); background(100); } function draw() { if( random( 25 ) < 1 ) { strokeWeight( 5/( random( 5 ) ) ); HilbertCurve(5); } strokeWeight( 1 ); r = sin(th)*128; ellipse(mouseX, mouseY, r, r); th += 0.1; } // end. |
2018(H30)-03-19(月) | OpenProcessing Prog.3
mlx = 0; mly = 0; th = 0; function setup() { createCanvas(windowWidth, windowHeight); background(100); } function draw() { // dd = windowHeight/2; if( ( mlx != mouseX )&&( mly != mouseY )&&( random( 25 ) < 1 ) ) { r = 10; step = 1.666; sN = 0.1; cX = windowWidth/4; cY = windowHeight/2; for( i=0; i<1; i++ ) { lX = -999; lY = -999; rN = random( 10 ); strokeWeight( 10/( random( 10 ) ) ) for( ang = 0; ang <1440; ang += 5 ) { thisR = r + ( noise( rN )*200 )-100; rad = radians( ang ); x = cX + ( thisR*cos( rad ) ); y = cY + ( thisR*sin( rad ) ); if( lX > -999 ) { line( x, y, lX, lY ); } lX = x; lY = y; r += step; rN += sN; } for( ang = 1435; ang >= 0; ang -= 5 ) { thisR = r + ( noise( rN )*200 )-100; rad = radians( ang ); x = cX*3 - ( thisR*cos( rad ) ); y = cY - ( thisR*sin( rad ) ); line( x, y, lX, lY ); lX = x; lY = y; r -= step; rN -= sN; } } } // strokeWeight( 1 ) mX = mouseX % dd; mY = mouseY % dd; // reg = 1 if( ( mouseX/dd < 1 ) ) { if( ( mouseY/dd < 1 ) ) { reg = 0; } else { reg = 1; } } else { if( ( mouseY/dd < 1 ) ) { reg = 1; } else { reg = 0; } } r = sin(th)*64; if( reg == 0 ) { ellipse(mX, mY, 20, 20); ellipse(mX+dd, mY+dd, 20, 20); } else { ellipse(mX+dd, mY, 20, 20); ellipse(mX, mY+dd, 20, 20); } // mlx = mouseX; mly = mouseY; th += 0.1 } |
|
2018(H30)-03-18(日) | ||
2018(H30)-03-17(土) | OpenProcessing Prog.1
ox=0; oy=0; function setup() { createCanvas(windowWidth, windowHeight); background(100); } function draw() { ellipse(mouseX, mouseY, abs(mouseX-ox), abs(mouseY-oy) ); ox = mouseX; oy = mouseY; }OpenProcessing Prog.2 ox=0; oy=0; function setup() { createCanvas(windowWidth, windowHeight); background(100); } function draw() { dx = abs(mouseX-ox); dy = abs(mouseY-oy); r = sqrt( dx*dx + dy*dy ); ellipse(mouseX, mouseY, r, r ); ox = mouseX; oy = mouseY; } |
|
日付 | |