Daily Creative Coding

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

球の上を動く円

/** * circles moving on sphere * * @author aa_debdeb * @date 2017/01/15 */ ArrayList<Circle> circles; void setup(){ size(640, 640); circles = new ArrayList<Circle>(); for(int i = 0; i < 30; i++){ circles.add(new Circle()); } } void draw(){ background(255)</circle></circle>…

CMYK網点

/** * CMYK halftone * * @author aa_debdeb * @date 2017/01/14 */ float[] sizeScale; void setup(){ size(640, 640); mousePressed(); } void mousePressed(){ sizeScale = new float[4]; for(int i = 0; i < 4; i++){ sizeScale[i] = random(1); } } voi…

円の影

/** * shadow of circle * * @author aa_debdeb * @date 2017/01/13 */ void setup(){ size(640, 640); noStroke(); background(255, 255, 250); } void draw(){ translate(width / 2, height / 2); rotate(PI / 4); for(int i = 0; i < 2; i++){ float angl…

グレイスケールのドット

/** * grayscale dots * * @author aa_debdeb * @date 2017/01/12 */ void setup(){ size(640, 640); noStroke(); mousePressed(); } void mousePressed(){ background(200); for(int i = 0; i < 2000; i++){ float x = random(-50, width + 50); float y = …

CMYのドット

/** * CMY dots * * @author aa_debdeb * @date 2017/01/11 */ void setup(){ size(640, 640); mousePressed(); } void mousePressed(){ ArrayList<Obj> objs = new ArrayList<Obj>(); color[] colors = {color(255, 0, 255), color(0, 255, 255), color(255, 255, 0)}</obj></obj>…

波状の円

/** * wavy circles * * @author aa_debdeb * @date 2017/01/10 */ void setup(){ size(640, 640); background(0, 0, 10); } void draw(){ fill(0, 0, 10, 100); noStroke(); rect(0, 0, width, height); translate(width / 2, height / 2); noFill(); for(i…

急にノイズが入るサイン波

/** * sine / noise * * @author aa_debdeb * @date 2017/01/09 */ void setup(){ size(640, 480); stroke(255, 255, 30); strokeWeight(2); noFill(); } void draw(){ background(0, 0, 20); float noiseRate = pow(abs(sin(frameCount * 0.01)), 150); beg…

残像のつくオシロスコープ

/** * ghost sine wave * * @author aa_debdeb * @date 2017/01/08 */ void setup(){ size(640, 480); background(0); } void draw(){ noStroke(); fill(0, 40); rect(0, 0,width, height); stroke(0, 255, 0); strokeWeight(3); noFill(); beginShape(); fo…

吸い込み口

/** * intake port * * @author aa_debdeb * @date 2017/01/07 */ int LOOP = 20; int ANGLE_NUM = 17; void setup(){ size(1000, 1000); } void draw(){ fill(0, 100); noStroke(); rect(0, 0, width, height); translate(width / 2, height / 2); rotate(-…

半透明なブロック

3D

/** * translucent blocks * * @author aa_debdeb * @date 2017/01/06 */ float W = 800; float H = 800; float BOX_WIDTH = 20; void setup(){ size(500, 500, P3D); fill(255, 50); stroke(255, 150); strokeWeight(2); } void draw(){ background(0); tra…

パーティクル同士の衝突と反射(3D)

/** * collision with many particles in 3D * * @author aa_debdeb * @date 2017/01/05 */ float MIN_RADIUS = 10; float MAX_RADIUS = 50; float e = 1.0; float k = 2.0; float rotX = 0; float rotY = 0; ArrayList<Particle> particles; void setup(){ size(500, </particle>…

パーティクル同士の衝突と反射

/** * collision with many particles and walls * * @author aa_debdeb * @date 2017/01/04 */ float e = 0.5; float k = 0.3; ArrayList<Particle> particles; void setup(){ size(500, 500); noStroke(); frameRate(30); particles = new ArrayList<Particle>(); while(partic</particle></particle>…

ゴムの紐

/** * elastic string * * @author aa_debdeb * @date 2017/01/03 */ int FPS = 30; int NODE_NUM = 100; float GRAVITY = 1.0; float K_SPRING = 10.0; float K_DAMPING = 10.0; PVector[] locs; PVector[] vels; float l; void setup(){ size(640, 640); f…

リング変調と振幅変調

/** * Ring Modulation vs. Amplitude Modulation * * @author aa_debdeb * @date 2017/01/02 */ import ddf.minim.spi.*; import ddf.minim.signals.*; import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.ugens.*; import ddf.minim.effe…

ペナルティ法による複数の円の衝突

/** * collision with many particles * * @author aa_debdeb * @date 2017/01/01 */ float e = 1.0; float k = 1.0; ArrayList<Particle> particles; void setup(){ size(500, 500); noStroke(); frameRate(30); particles = new ArrayList<Particle>(); while(particles.size() </particle></particle>…

撃力ベース法による円の衝突

/** * collision with two particles * * @author aa_debdeb * @date 2016/12/31 */ Particle p1, p2; float e = 0.5; void setup(){ size(500, 500); noStroke(); fill(#BF1E56); initialize(); } void initialize(){ float velSize = 3; float velAng1 = H…

ベクトル計算によるパーティクルの壁面での反射

/** * reflection of a particle * * @author aa_debdeb * @date 2016/12/30 */ int COUNT = 200; PVector loc, vel; float circleR = 30; void setup(){ size(500, 500); noStroke(); initialize(); } void initialize(){ loc = new PVector(width / 2, hei…

ローテーター

/** * rotators * * @author aa_debdeb * @date 2016/12/29 */ int LOOP = 50; int NUM = 12; int BOX_SIZE = 15; float SPHERE_SIZE = 120; void setup(){ size(500, 500, P3D); noStroke(); } void draw(){ background(#FCF1D3); translate(width / 2, hei…

昔のコンピュータの画面風スケッチ

/** * old computer display * * @author aa_debdeb * @date 2016/12/28 */ float time = 0; void setup(){ size(640, 480); frameRate(60); } void draw(){ background(0); if(frameCount % 4 != 0){ stroke(0, 150, 0); for(int h = 0; h < height; h += 4…

三角形のループ

/** * triangle loop * * @author aa_debdeb * @date 2016/12/27 */ float MAX_RADIUS = 200; int LOOP = 120; color bg = color(219, 175, 184); color c1 = color(153, 14, 42); color c2 = color(220, 20, 60); void setup(){ size(500, 500); noStroke()…

水面から飛び出るパーティクル

/* * particles from water * * @author aa_debdeb * @date 2016/12/26 */ float gravity = 0.15; ArrayList<Particle> particles; color c1 = color(173, 216, 230); color c2 = color(100, 149, 237); void setup(){ size(480, 360); noStroke(); particles = new Ar</particle>…

サイン波を累乗する

/** * exponential sine tooth * * @author aa_debdeb * @date 2016/12/25 */ void setup(){ size(500, 500); noStroke(); } void draw(){ background(146, 250, 0); int[] powers = {2, 4, 10, 40}; color[] colors = {color(200), color(250, 0, 246), col…

ひっくり返る四角形

/** * rect flip * * @author aa_debdeb * @date 2016/12/24 */ int X_NUM = 5; int Y_NUM = 5; void setup(){ size(640, 640); rectMode(CENTER); noStroke(); fill(100); } void draw(){ background(230); translate(width / 2, height / 2); for(int y = …

円のループ

/** * loop of circles * * @author aa_debdeb * @date 2016/12/23 */ int NUM = 24; void setup(){ size(640, 640); noStroke(); } void draw(){ background(0, 0, 30); translate(width / 2, height / 2); for(int i = 0; i < NUM; i++){ float angle = i …

四角形で塗りつぶす

/** * fill by rect * * @author aa_debdeb * @date 2016/12/22 */ float RECT_WIDTH = 150; PVector offset; void setup(){ size(500, 500); rectMode(CENTER); offset = new PVector(random(10000), random(10000)); background(220); } void draw(){ noSt…

動く階段

3D

/* * moving steps * * @author aa_debdeb * @date 2016/12/21 */ float DISPLAY_WIDTH = 450; float BLOCK_WIDTH = 20; PVector loc; void setup(){ size(500, 500, P3D); noStroke(); fill(255, 255, 0); loc = new PVector(random(10000), random(10000))…

回転する三角形

/** * triangles * * @author aa_debdeb * @date 2016/12/20 */ int LOOP = 200; float radius = 70; void setup(){ size(500, 500); stroke(200); strokeWeight(3); fill(204, 204, 0); } void draw(){ background(0, 0, 30); translate(width / 2.0, heigh…

スライドイン / スライドアウト

/** * slide in / slide out * * @author aa_debdeb * @date 2016/12/19 */ int RECT_NUM = 5; float RECT_WIDTH = 35; float RECT_GAP = 80; int LOOP = 120; void setup(){ size(500, 500); rectMode(CENTER); noStroke(); fill(255); } void draw(){ back…

揺れる球

/** * swaying balls * * @author aa_debdeb * @date 2016/12/18 */ int LOOP = 120; int NUM = 24; void setup(){ size(500, 500); noStroke(); fill(255); } void draw(){ background(0); translate(width / 2, height / 2); for(int i = 0; i < NUM; i++)…

歯車

/** * gears * * @author aa_debdeb * @date 2016/12/17 */ float bigR = 100; float smallR = 90; float angleStep = 5; float time = 0.0; void setup(){ size(500, 500); } void draw(){ background(255); translate(width / 2, height / 2); float dist …