Daily Creative Coding

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

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

パーティクル

/** * Particle System * * @author aa_debdeb * @date 2015/10/01 */ float PARTICLE_RADIOUS = 3.0; float PARTICLE_NUM = 1000; float FORCE = 6.0; ArrayList<Particle> particles; void setup(){ size(500, 500); smooth(); frameRate(24); noStroke(); particles</particle>…

線でノイズのある円を描く

/** * Unstable Colorful Circle * * @author aa_debdeb * @date 2015/09/30 */ float RADIOUS = 175; float RADIOUS_VARIANT = 75; float RADIAN_VARIANT = PI / 32; float RADIOUS_NOISE_STEP = 0.01; float RADIAN_NOISE_STEP = 0.01; float COLOR_NOISE_…

円のグラデーションが変化し続ける

/** * Endless Gradational Circle * * @author aa_debdeb * @date 2015/09/29 */ float ANGLE_STEP = PI / 64; float angle = 0.0; float targetColorR; float targetColorG; float targetColorB; float currentColorR; float currentColorG; float current…

パーリンノイズでブロックを波立たせる

3D

JavaScriptモードとJavaモードで描かれるものが異なる. Javaモードを推奨. /** * 3D Perlin Blocks * * @author aa_debdeb * @date 2015/09/28 */ void setup(){ size(500, 500, P3D); smooth(); frameRate(24); lights(); camera(1500, 500, 1200, 500, 5…

xy格子をz軸に対して回転させる

3D

JavaScriptモードとJavaモードで描かれるものが異なる. Javaモードを推奨. /** * Rotation of XY Grid * * @author aa_debdeb * @date 2015/09/27 */ void setup(){ size(500, 500, P3D); smooth(); frameRate(24); camera(1500, 500, 1500, 500, 500, 0, …

カメラを回転させる

3D

/** * Rotation of Camera * * @author aa_debdeb * @date 2015/09/26 */ float CAMERA_RADIOUS = 1000; float CAMERA_RADIAN_SPEED = PI / 64; float radian1; float radian2; float radianSpeed1; float radianSpeed2; float centerX; float centerY; floa…

球の周りに小さな球を公転させる

3D

/** * 3D Orbital System * * @author aa_debdeb * @date 2015/09/25 */ float ORBITAL_RADIOUS = 100; int SPHERE_NUM = 50; float SPHERE_RADIOUS = 5; float SPHERE_RADIAN_SPEED = PI / 32; ArrayList<Sphere> spheres; void setup(){ size(500, 500, P3D); smoo</sphere>…

x軸を回転させる

3D

/** * Rotation of X Angle * * @author aa_debdeb * @date 2015/09/24 */ float rotationX = 0.0; float rotationXStep = PI / 64; void setup(){ size(500, 500, P3D); smooth(); frameRate(24); } void draw(){ rotationX += rotationXStep; if(abs(rotat…

camera関数の使い方チェック

3D

カメラ位置 x方向にマイナス:a x方向にプラス:d y方向にマイナス:w y方向にプラス:x z方向にマイナス:↑ z方向にプラス:↓ javascriptモードだとキーボード入力がうまくいかない? /** * 3D Camera Check 1 * * @author aa_debdeb * @date 2015/09/23 */…

球を箱状に並べる

3D

/** * 3D Box Spheres * * @autor aa_debdeb * @date 2015/09/22 */ void setup(){ size(500, 500, P3D); smooth(); background(255); sphereDetail(40); lights(); camera(0, 0, 0, width / 2, height/2, 100, 0, 1, 0); noStroke(); for(int xi = 0; xi < …

円で描いた螺旋を回す

/** * Spiral Circle * * @author aa_debdeb * @date 2015/09/21 */ float rotateAngleStep = PI / 32; float positionRadiousStep = 2; float circleRadious = 20; float degreeStep = 10; void setup(){ size(500, 500); smooth(); frameRate(24); noStrok…

Overlapping Pentagons

/** * Overlapping Pentagons * * @author aa_debdeb * @date 2015/09/20 */ void setup(){ size(500, 500); smooth(); noStroke(); background(255); for(int i = 0; i < 5; i++){ float radious = i * 80; float radianStep = 2.0 * PI / 5.0; fill(0, 0, …

トゲトゲの円

/** * Stinging Circle * * @author aa_debdeb * @date 2015/09/19 */ float RADIOUS = 200; float RADIOSU_VARIANT = 20; float CENTER_X; float CENTER_Y; float time = 0.0; float TIME_STEP = PI / 32.0; void setup(){ size(500, 500); smooth(); noStr…

円を脈動させる

/** * Expanding Circle * * @author aa_debdeb * @date 2015/09/18 */ float RADIOUS = 150; float RADOUS_VARIANT = 100; float TIME_STEP = 0.01; float time = 0.0; void setup(){ size(500, 500); smooth(); frameRate(24); noStroke(); background(255…

マウスをノイズのある円で追いかける

/** * Tracing of Mouse By Unstable Circles * * @author aa_debdeb * @date 2015/09/17 */ int MAX_CIRCLE_NUM = 100; float RADIOUS = 100; float RADIOUS_VARIANT_SIZE = 20; float POSITION_VARIANT_SIZE = 20; ArrayList<Circle> circles; void setup(){ size(</circle>…

重ならないように円を描き続ける

/** * Too Much Circles * * @author aa_debdeb * @date 2015/09/16 */ float MAX_RADIOUS = 20; float MIN_RADIOUS = 5; ArrayList<Circle> circles; void setup(){ size(500, 500); smooth(); background(255); circles = new ArrayList<Circle>(); } void draw(){ Circle </circle></circle>…

様々な色の円を描き続ける

/** * Endless Circles * * @author aa_debdeb * @date 2015/09/15 */ float centerX; float centerY; float startAngle; float endAngle; float currentAngle; float colorR; float colorG; float colorB; float radious; float ANGLE_STEP = PI / 32; floa…

線の太さが変化する円を書き続ける

/** * Unstable Circle * * @author aa_debdeb * @date 2015/09/14 */ float ROTATION_RADIOUS = 150; float CENTER_X; float CENTER_Y; float MAX_STROKE_WEIGHT = 75.0; float TIME_STEP = 0.03; float ANGLE_STEP = PI / 128; float time = 0.0; float an…

スクラッチ!

マウスをクリックすると,スクラッチできる. /** * Scratch * * @author aa_debdeb * @date 2015/09/13 */ float CELL_SIZE = 10; boolean[][] isScratched; void setup(){ size(500, 500); smooth(); noStroke(); frameRate(30); isScratched = new boolea…

光の伝播

隣接している円が点灯していると自分も光る. ブーリアンネットワークみたいな感じ. ときたま,周期的に光り続ける状態に陥る. /** * Propagation of Lights * * @autor aa_debdeb * @date 2015/09/12 */ int LIGHT_NUM = 100; float MAX_LIGHT_RADIOUS = …

Perlinノイズでグニョグニョと立ち現れる

JavaScriptモードでは上手く,機能しない. Javaモードでの実行を推奨. /** * Emergence of Perlin Noise * * @autor aa_debdeb * @date 2015/09/11 * */ float t = 0.0; // step size for time float tStep = 0.02; float step = 0.01; float appearRate =…

Processingで書道

マウスをゆっくりドラッグすると濃く太い線が,マウスを素早くドラッグすると薄く細い線が書ける. キーボードのいずれかのキーをクリックすると,画面がクリアされる. /** * Calligraphy System * * Bold and dark line is drawn by dragging mouse slowly…

任意の2つの色でグラデーション

/** * Two Color Gradation * * @autor aa_debdeb * @date 2015/09/09 */ // color1 float r1 = 255.0; float g1 = 20.0; float b1 = 147.0; // color2 float r2 = 255.0; float g2 = 215.0; float b2 = 0.0; void setup(){ size(500, 500); loadPixels(); f…

Ripple

/** * Ripple * * @author aa_debdeb * @date 2015/09/08 */ float RIPPLE_INITIAL_RADIOUS = 5.0; float RIPPLE_RADIOUS_STEP_SIZE = 3.0; float RIPPLE_TRANSPARENCY_STEP_SIZE = 5.0; float NEW_RIPPLE_RATE = 0.05; ArrayList<Ripple> ripples; void setup(){ si</ripple>…

Triangle Wave Change VS. Sine Wave Change

/** * Triangle Wave Change VS. Sine Wave Change * * left: color change by triangle wave, right: color change by sine wave * * @author aa_debdeb * @date 2015/09/07 */ float T_STEP_SIZE = PI / 128.0; float t = 0.0; void setup(){ size(500, 25…

Wriggle

/** * Wriggle * * @author aa_debdeb * @date 2015/09/06 */ float TIME_STEP = 0.03; float H_STEP = 0.01; float time = 0.0; void setup(){ size(500, 500); smooth(); frameRate(60); } void draw(){ background(255); stroke(0); strokeWeight(1); for…

Evolution of Checkered Pattern

/** * Evolution of Checkered Pattern * * Checkered pattern is evolved by genetic algorithm * * @author aa_debdeb * @date 2015/09/05 */ float CHECK_SIZE = 10.0; int CHECK_WIDTH = 50; int CHECKS_SIZE = 20; float MUTATION_RATE = 0.001; ArrayL…

Surfacing Bubbles

/** * Surfacing Bubbles * * @author aa_debdeb * @date 2015/09/04 */ float BG_GRA_STEP_SIZE = 5.0; float MAX_BUBBLE_RADIOUS = 20.0; float MAX_BUBBLE_X_SPEED = 3.0; float BUBBLE_Y_SPEED = 5.0; float NEW_BUBBLE_RATE = 0.7; ArrayList<Bubble> bubbles; </bubble>…

Sine Surface Movement

/** * Sine Surface Movement * * @author aa_debdeb * @date 2015/09/03 */ float BLOCK_SIZE = 5; int BLOCK_NUM = 100; float radian = 0.0; float radianStep = PI / 100; void setup(){ size(501, 501); smooth(); frameRate(30); } void draw(){ strok…

One Eye Tracks Mouse

/** * One Eye Tracks Mouse * * @author aa_debdeb * @date 2015/09/02 */ float centerX; float centerY; float outlineDiameter = 250; float outlineRadious = outlineDiameter / 2.0; float pupilDiameter = 150; float pupilRadious = pupilDiameter /…