Daily Creative Coding

元「30 min. Processing」。毎日、Creative Codingします。

2015-10-01から1ヶ月間の記事一覧

ベジエ曲線を重ねる

/** * Beziers * * @author aa_debdeb * @date 2015/10/31 */ void setup(){ size(500, 500); smooth(); frameRate(24); } void draw(){ background(0); stroke(255); strokeWeight(1); noFill(); translate(100, height/2); for(int i = 0; i < 100; i++){ …

パッチワークで画像を再構成する

/** * Patchwork Image * * @author aa_debdeb * @date 2015/10/30 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] colors = new color[width][height]; for(int x = 0; x < width; …

画像処理の基礎3

画像を重ねる(多重露光する) /** * Multiple Exposure * * @author aa_debdeb * @date 2015/10/29 */ void setup(){ size(640, 424); PImage image1 = loadImage("image1.jpg"); PImage image2 = loadImage("image2.jpg"); image(image1, 0, 0); tint(255,…

画像をファミコン風にする

/** * Image Like Super NES * * @author aa_debdeb * @date 2015/10/28 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); int cLevel = 5; int levelStep = 255 / cLevel; for(int x = 0; x < w…

画像処理の基礎2

画像の色を反転する /** * Reversed Color Image * * @author aa_debdeb * @date 2015/10/27 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); for(int x = 0; x < width; x++){ for(int y = 0; …

画像から点描画をつくる

/** * Pointilism Image * * @author aa_debdeb * @date 2015/10/26 */ void setup(){ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] colors = new color[width][height]; for(int x = 0; x < width;…

画像のエッジを検出する(Sobelフィルター)

/** * Edge Detection by Sobel Filter * * @author aa_debdeb * @date 2015/10/23 */ PImage image; void setup(){ size(512, 512); noStroke(); image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] greys = new color[width][he…

画像をぼかす

/** * Blurred Image * * @author aa_debdeb * @date 2015/10/24 */ int blurWidth = 15; void setup(){ size(512, 512); noStroke(); PImage image = loadImage("lena.jpg"); image(image, 0, 0); loadPixels(); color[][] colors = new color[width][heigh…

画像処理の基礎1

画像を表示する /** * Display Image * * @author aa_debdeb * @date 2015/10/23 */ size(512, 512); PImage image = loadImage("lena.jpg"); image(image, 0, 0); 画像に色をつける /** * Tint Image * * @author aa_debdeb * @date 2015/10/23 */ PImage i…

魔法陣

/** * Magic Square * * @author aa_debdeb * @date 2015/10/22 */ ArrayList<Bridge> bridges = new ArrayList<Bridge>(); void setup(){ size(500, 500); smooth(); frameRate(24); bridges = new ArrayList<Bridge>(); for(int i = 0; i < 30; i++){ bridges.add(new Bridge()); }</bridge></bridge></bridge>…

回転灯

/** * Revolving Light * * @author aa_debdeb * @date 2015/10/21 */ void setup(){ size(500, 500); smooth(); frameRate(24); background(0); } void draw(){ noStroke(); fill(0, 30); rect(-1, -1, width, height); stroke(255, 255, 0); strokeWeight(…

ラビリンス

/** * Labyrintch * * @author aa_debdeb * @date 2015/10/20 */ ArrayList<Mover> movers = new ArrayList<Mover>(); boolean[][] grids; float gridWidth = 5; void setup(){ size(500, 500); smooth(); frameRate(24); background(0); stroke(0, 255, 0); strokeWeight(</mover></mover>…

Circle by Worms

processing.jsのnoise関数にはバグがあるようなので,Javaモードで実行すると次の画像のような違う挙動を示す . /** * Circle by Worms * * @author aa_debdeb * @date 2015/10/19 */ ArrayList<Mover> movers; void setup(){ size(500, 500); smooth(); frameRate</mover>…

ツイストする四角形

/** * Twisting Rectangle * * @author aa_debdeb * @date 2015/10/18 */ void setup(){ size(500, 500); smooth(); frameRate(24); } void draw(){ fill(0, 150); rect(-1, -1, width, height); noStroke(); fill(0, 255, 0, 200); translate(width/2, heig…

ラインで複雑なスパイラル2

/** * 4 Spirals By Line * * @author aa_debdeb * @date 2015/10/17 */ ArrayList<PVector> circles = new ArrayList<PVector>(); float radious1 = 200, radious2 = 75; void setup(){ size(500, 500); smooth(); frameRate(24); background(0); circles.add(new PVector(75,</pvector></pvector>…

波打つ花

/** * Billowing Flower * * @author aa_debdeb * @date 2015/10/16 */ float radious1 = 200, radious2 = 100; void setup(){ size(500, 500); smooth(); // frameRate(24); background(0); } void draw(){ noStroke(); fill(0, 50); rect(-1, -1, width + …

ラインで複雑なスパイラル

/** * Spiral By Line * * @author aa_debdeb * @date 2015/10/15 */ float radious1 = 200, radious2 = 150; void setup(){ size(500, 500); smooth(); frameRate(24); background(0); } void draw(){ noStroke(); fill(0, 100); rect(-1, -1, width + 1, h…

Transforming Dots

/** * Transforming Dots * * @author aa_debdeb * @date 2015/10/14 */ void setup(){ size(500, 500); smooth(); frameRate(24); } void draw(){ background(30); noStroke(); fill(255, 20, 147, 150); translate(width/2, height/2); for(int x = -100; …

重なる透明な円

/** * Overlapping Transparent Circles * * @author aa_debdeb * @date 2015/10/13 */ void setup(){ size(500, 500); smooth(); frameRate(24); background(0); stroke(0, 112, 142, 50); noFill(); translate(100, 100); for(int x = 0; x <= 300; x++){ …

成長する木々

/** * Branching Trees * * @author aa_debdeb * @date 2015/10/12 */ float NEW_TREE_PROB = 0.05; float MAX_BRANCH_PROB = 0.5; float MIN_DYING_PROB = 0.05; float BRANCH_PROB_DIFF = 0.03; float DYKING_PROB_DIFF = 0.05; float MAX_BRANCH_GROWTH =…

ばね

/** * Springs * * @author aa_debdeb * @date 2015/10/11 */ int SPRING_NUM = 30; float SPRING_COEFFICNET = 0.01; PVector center; ArrayList<Spring> springs; void setup(){ size(500, 500); smooth(); frameRate(24); center = new PVector(width/2, height/2</spring>…

マウスを追いかけるパーティクル

/** * Particles * * @author aa_debdeb * @date 2015/10/10 */ int PARTICLE_NUM = 1000; float PARTICLE_RADIOUS = 1.5; float PARTICLE_MAX_SPEED = 10.0; float PARTICLE_MAX_ACCELERATION = 1.0; float PARTICLE_IMPACT_SPEED = 300; float PARTICLE_SP…

崩壊したシェルピンスキーのカーペット

/** * Disrupted Sierpinski Carpet * * @author aa_debdeb * @date 2015/10/09 */ int MAX_DEPTH = 5; int MAX_SIZE = 500; float MAX_XY_NOISE_RATIO = 0.3; float MAX_SIZE_NOISE_RATIO = 0.3; Square root; void setup(){ size(500, 500); smooth(); noS…

定常波

/** * Standing Waves * * @author aa_debdeb * @date 2015/10/08 */ ArrayList<StandingWave> standingWaves; void setup(){ size(500, 500); smooth(); frameRate(24); standingWaves = new ArrayList<StandingWave>(); float angularFrequency = TWO_PI; for(int i = 0; i < 30; i++){</standingwave></standingwave>…

円の中の円

/** * Circles in Circles * * @author aa_debdeb * @date 2015/10/07 */ int MAX_DEPTH = 5; float MAX_RADIAN_SPEED = PI / 64; Circle root; void setup(){ size(500, 500); smooth(); frameRate(24); noStroke(); root = new Circle(); } void draw(){ c…

シェルピンスキーのカーペット

/** * Sierpinski Carpet * * @author aa_debdeb * @date 2015/10/05 */ int MAX_DEPTH = 5; int MAX_SIZE = 500; void setup(){ size(500, 500); smooth(); noStroke(); Square root = new Square(); root.draw(); } class Square{ PVector topLeft; float …

吸収・爆発するパーティクル

/** * Particles for Absorption and Explosion * * @author aa_debdeb * @date 2015/10/04 */ float MAX_RADIOUS = 100; float MAX_SPEED = 20; float EXPLOSION_NUM = 10; ArrayList<Particle> particles; void setup(){ size(500, 500); smooth(); frameRate(24); n</particle>…

爆発するパーティクル

/** * Explosion Particle * * * @author aa_debdeb * @date 2015/10/04 */ float MAX_RADIOUS = 20; float MAX_SPEED = 5; float MAX_RECURSION = 3; float EXPLOSION_RATE = 0.1; float NEW_PARTICLE_RATE = 0.1; ArrayList<Particle> particles; void setup(){ size</particle>…

パーティクル

3D

JavaScriptモードだとcamera関数が機能しない? /** * 3D Particle System * * @author aa_debdeb * @date 2015/10/03 */ float PARTICLE_RADIOUS = 3.0; float PARTICLE_NUM = 1000; float FORCE = 2.0; ArrayList<Particle> particles; void setup(){ size(500, 500,</particle>…

反発・誘引するパーティクル

同じ色のパーティクルは反発する. 違う色のパーティクルは引き付け合う. JavaScriptモードでは重すぎて動かない. /** * Two Color Particles * * Particles with same color repel each other, particles with different color attract each other. * * @…