Daily Creative Coding

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

2016-08-01から1ヶ月間の記事一覧

4つの正方形上を動く円

/** * four moving circles * * @author aa_debdeb * @date 2016/08/31 */ PVector[] vertices; float pos = 75; void setup(){ size(500, 500); fill(0, 75, 77); stroke(0, 206, 209); strokeWeight(30); vertices = new PVector[4]; vertices[0] = new PV…

シンプルな2Dシューティングゲーム

/** * simple 2D shooter game * * @author aa_debdeb * @date 2016/08/30 */ Myself myself; ArrayList<Enemy> enemies; ArrayList<Bullet> myBullets; ArrayList<Bullet> eneBullets; void setup(){ size(640, 640); rectMode(CENTER); myself = new Myself(); enemies = new Arra</bullet></bullet></enemy>…

4つの回転する正方形

/** * four spining squares * * @author aa_debdeb * @date 2016/08/29 */ void setup(){ size(500, 500); rectMode(CENTER); fill(255, 128, 234); stroke(255); strokeWeight(20); } void draw(){ background(127, 255, 212); translate(width / 2, heigh…

中心に集中する線

/** * lines to center * * @author aa_debdeb * @date 2016/08/28 */ ArrayList<Particle> particles; void setup(){ size(500, 500); colorMode(HSB, 360, 100, 100); particles = new ArrayList<Particle>(); strokeWeight(2); } void draw(){ background(0, 100, 0); transla</particle></particle>…

ギリギリで重ならないように回転する円

/** * unoverlapped spining cirlces * * @author aa_debdeb * @date 2016/08/27 */ color bg; color col[]; ArrayList<Spin> spins; void setup(){ size(500, 500); noStroke(); colorMode(HSB, 360, 100, 100); initialize(); } void mousePressed(){ initialize</spin>…

重ならないように回転する球

/** * cycling of balls * * @author aa_debdeb * @date 2016/08/26 */ color bg; ArrayList<Spin> spins; void setup(){ size(500, 500); initialize(); } void mousePressed(){ initialize(); } void initialize(){ spins = new ArrayList<Spin>(); for(int i = 0; i <</spin></spin>…

ひし形を連ねる

/** * chain of diamonds * * @author aa_debdeb * @date 2016/08/25 */ float rectSize = 20; void setup(){ size(500, 500, P3D); rectMode(CENTER); noFill(); stroke(255); } void draw(){ background(0); for(int x = 0; x * rectSize + rectSize / 2 <…

サイバーな花火

/** * cyber firework * * @author aa_debdeb * @date 2016/08/24 */ ArrayList<Beam> beams; void setup(){ size(800, 800, P3D); colorMode(HSB, 360, 100, 100); beams = new ArrayList<Beam>(); } void mousePressed(){ explode(); } void keyPressed(){ explode(); </beam></beam>…

パーリンノイズを格子状に配置された四角形の大きさで可視化する

/** * cloud of rect * * @author aa_debdeb * @date 2016/08/23 */ float step = 5; PVector offset; void setup(){ size(800, 800); rectMode(CENTER); noStroke(); fill(0); offset = new PVector(random(10000), random(10000), random(10000)); } void …

多環の球

/** * multi-ringed sphere * * @author aa_debdeb * @date 2016/08/22 */ float step = 5; color c1 = color(0, 206, 209); color c2 = color(255, 215, 0); void setup(){ size(500, 500, P3D); noFill(); } void draw(){ background(0); translate(width …

斜め線

/** * slanting lines * * @author aa_debdeb * @date 2016/08/21 */ float e = 2; void setup(){ size(500, 500); noStroke(); mousePressed(); } void draw(){} void mousePressed(){ background(random(255), random(255), random(255)); fill(random(255…

疎密波

/** * compressional wave * * @author aa_debdeb * @date 2016/08/20 */ void setup(){ size(640, 480); rectMode(CENTER); noStroke(); fill(0); } void draw(){ background(255); translate(width / 2, height / 2); for(float x = -200; x <= 200; x += …

パーティクルでいろいろな形をつくる

/** * morph by particles * * @author aa_debdeb * @date 2016/08/19 */ int state = 0; ArrayList<Particle> particles; void setup(){ size(500, 500, P3D); particles = new ArrayList<Particle>(); for(int i = 0; i < 5000; i++){ particles.add(new Particle()); } } void</particle></particle>…

パーティクルで構成された球

/** * sphere composed of particles * * @author aa_debdeb * @date 2016/08/18 */ float scale = 100; float phi = (1 + sqrt(5)) / 2.0; ArrayList<Particle> particles; void setup(){ size(500, 500, P3D); PVector[] vertices = {new PVector(0, 1, phi), new PV</particle>…

ジオデシック・ドーム

3D

/** * Geodesic Dome * * @author aa_debdeb * @date 2016/08/17 */ int state = 0; float scale = 100; float phi = (1 + sqrt(5)) / 2.0; float radious = sqrt(sq(1) + sq(phi)); ArrayList<Triangle> triangles; void setup(){ size(500, 500, P3D); PVector[] ver</triangle>…

降る雪

/** * snowfall * * @author aa_debdeb * @date 2016/08/16 */ float MIN_PARTICLE_DIAMETER = 2; float MAX_PARTICLE_DIAMETER = 7; float MAX_PARTICLE_VELOCITY_X = 0.5; float MAX_PARTICLE_VEL_VARIANT_X = 0.1; float MAX_PARTICLE_VELOCITY_Y = 0.5; …

編みこみ斜め格子

/** * knitted skew lattice * * @author aa_debdeb * @date 2016/08/15 */ float step = 20; float stepNum = 25; float border = 5; void setup(){ size(500, 500); mousePressed(); } void draw(){ } void mousePressed(){ background(random(255), rando…

編みこみ格子

/** * knitted lattice * * @author aa_debdeb * @date 2016/08/14 */ float step = 20; float border = 10; void setup(){ size(500, 500); mousePressed(); } void draw(){ } void mousePressed(){ background(random(255), random(255), random(255)); co…

茂み

/** * grove * * @author aa_debdeb * @date 2016/08/12 */ void setup(){ size(640, 480, P3D); mousePressed(); } void mousePressed(){ background(60, 179, 113); translate(width / 2, height * (4.0 / 5), -300); stroke(255); for(int i = 0; i < 6; …

三次元の再帰木

3D

/** * 3D recursive tree * * @author aa_debdeb * @date 2016/08/12 */ Tree tree; void setup(){ size(640, 480, P3D); tree = new Tree(); } void draw(){ background(60); translate(width / 2, height * (4.0 / 5)); rotateX(map(mouseY, 0, width, -PI…

カテナリー曲線

/** * catenaries * * @author aa_debdeb * @date 2016/08/11 */ void setup(){ size(500, 500); mousePressed(); } void draw(){} void mousePressed(){ background(248, 248, 255); noFill(); for(int i = 0; i < 150; i++){ float a = random(1, 2); PVec…

踊るリング

/** * dancing ring * * @author aa_debdeb * @date 2016/08/10 */ void setup(){ size(640, 480, P3D); noFill(); stroke(255); strokeWeight(3); } void draw(){ background(0, 206, 209); translate(width / 2, height / 2); rotateY(frameCount * 0.02);…

似非流体

/** * fake fluid * * @author aa_debdeb * @date 2016/08/09 */ int cellNum = 200; float cellSize = 2; ArrayList<Particle> particles; void setup(){ size(400, 400); particles = new ArrayList<Particle>(); for(int i = 0; i < 150000; i++){ particles.add(new Particle</particle></particle>…

侵入型パーコレーションモデル

/** * invation percolation model * * @author aa_debdeb * @date 2016/08/08 */ float[][] values; int[][] states; ArrayList<PVector> targets; int[][] dir = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; void setup(){ size(400, 400); frameRate(360); values = new </pvector>…

二色のメタボール

/** * two-color metaballs * * @author aa_debdeb * @date 2016/08/07 */ int num = 20; ArrayList<Particle> particles; int cellNum = 200; float cellSize = 2; float[][] cells; color c1 = color(255, 140, 0); color c2 = color(0, 242, 255); void setup(){ si</particle>…

なびく面

3D

/* * surface in the wind * * @author aa_debdeb * @date 2016/08/06 */ int num = 50; int step = 20; float scale = 0.1; PVector[] offsets; void setup(){ size(500, 500, P3D); fill(220, 20, 60); stroke(0); strokeWeight(1); offsets = new PVector…

バリステック凝集モデル

/** * Balistic Aggregation Model * * @author aa_debdeb * @date 2016/08/05 */ int[] stacks; void setup(){ size(300, 300); frameRate(360); noFill(); stroke(0); initialize(); } void mousePressed(){ initialize(); } void initialize(){ backgroun…

Nagel–Schreckenbergモデルによる交通流シミュレーション

/** * Nagel–Schreckenberg model * * @author aa_debdeb * @date 2016/08/04 */ int maxVel = 5; float p = 0.4; ArrayList<Car> cars; void setup(){ size(500, 500); int pos = 0; cars = new ArrayList<Car>(); while(pos < width){ pos += int(random(1, 7)); car</car></car>…

波の干渉

/** * wave interference * * @author aa_debdeb * @date 2016/08/03 */ float step = 5; float maxAmp = 100; float minAmp = 20; float maxDistance = 300; float minDistance = 50; float maxSpeed = 0.2; float minSpeed = 0.01; float maxInterval = PI…

パーリンノイズの風景

/** * landscape of perlin noise * * @author aa_debdeb * @date 2016/08/02 */ void setup(){ size(500, 500); noFill(); mousePressed(); } void draw(){} void mousePressed(){ float noiseX = random(10000); float noiseY = random(10000); float[][] …