読者です 読者をやめる 読者になる 読者になる

30 min. Processing

毎日30分、Processingで何かを作る

スウィープすると消える円 #2

/** * sweep bubbles #2 * * @author aadebdeb * @date 2017/03/16 */ var easingVariables; var circles; function setup() { createCanvas(windowWidth, windowHeight); frameRate(30); easingVariables = []; circles = []; for (var i = 0; i < 1000; i+…

スウィープすると消える円

/** * sweep bubbles * * @author aadebdeb * @date 2017/03/15 */ var easingVariables; var circles; function setup() { createCanvas(windowWidth, windowHeight); frameRate(30); easingVariables = []; circles = []; for (var i = 0; i < 500; i++) {…

触れると小さくなり消える円

/** * touchable bubbles * * @author aadebdeb * @date 2017/03/14 */ var easingVariables; var circles; function setup() { createCanvas(windowWidth, windowHeight); colorMode(HSB, 360, 100, 100, 100); frameRate(30); easingVariables = []; circl…

触れると膨らむ円

/** * expanding circles * * @author aadebdeb * @date 2017/03/13 */ var eventManager; function setup() { createCanvas(windowWidth, windowHeight); frameRate(30); eventManager = new EventManager(); for (var i = 0; i < 100; i++) { eventManager…

マウスクリックで線が伸びるスケッチ

/** * expanding lines by mouse click * * @author aadebdeb * @date 2017/03/12 */ var eventManager; function setup() { createCanvas(windowWidth, windowHeight); frameRate(30); eventManager = new EventManager(); } function draw() { eventManage…

上から落ちてくる糸

/** * fall from ceiling * * @author aadebdeb * @date 2017/03/11 */ var offset; var shows; var actionFrames = 15; var counter = 0; function setup() { createCanvas(windowWidth, windowHeight); frameRate(60); offset = random(10000); event= fal…

shearXで歪められた市松模様

/** * sheared squares * * @author aadebdeb * @date 2017/02/22 */ var speed; function setup() { createCanvas(windowWidth, windowHeight); frameRate(15); rectMode(CENTER); speed = 0; } function draw() { var pspeed = speed; speed = mouseX - pm…

p5.jsでドロネー三角形分割

/* * delaunay triangulation * * @author aadebdeb * @date 2017/02/08 */ var delaunayTriangulation; var hue; function setup() { createCanvas(windowWidth, windowHeight); colorMode(HSB, 360, 100, 100); hue = random(360); delaunayTriangulation …

並んだ板

/** * boards in line * * @author aadebdeb * @date 2017/01/26 */ void setup(){ size(640, 480); rectMode(CENTER); fill(20); stroke(255, 251, 249); strokeWeight(4); } void draw(){ background(255, 251, 249); translate(width / 2, height / 2); i…

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

/** * 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…

マウスの動きをパーティクルで可視化する

/** * mouse impact * * @author aa_debdeb * @date 2016/12/08 */ float historySize = 5; ArrayList<PVector> mouseVelocities; ArrayList<Particle> particles; void setup(){ size(640, 640); noStroke(); fill(255); mouseVelocities = new ArrayList<PVector>(); particles = new A</pvector></particle></pvector>…

円から四角に変形するオブジェクト

/** * morphing between circle and square * * @author aa_debdeb * @date 2016/12/03 */ float radius = 200; int pointNum = 1000; PVector[] circlePoints; PVector[] rectPoints; float shapeRate = 0.0; float shapeRateSpeed = -0.005; color circleC…

キラキラする円

/** * illuminated circles * * @author aa_debdeb * @date 2016/12/02 */ ArrayList<Circle> circles; void setup(){ size(640, 640); noStroke(); colorMode(HSB, 360, 100, 100); circles = new ArrayList<Circle>(); for(int i = 0; i < 10000; i++){ float radius = ran</circle></circle>…

触れると動くスライム

/** * touchable slime * * @author aa_debdeb * @date 2016/11/29 */ float noiseValue; float time; void setup(){ size(640, 640); noiseValue = 0.5; time = 0.0; background(150); } void draw(){ fill(150, 100); rect(0, 0, width, height); translat…

火花

/** * sparks * * @author aa_debdeb * @date 2016/11/28 */ float MAX_VEL = 5; float MAX_SIZE = 8.0; ArrayList<Particle> particles; void setup(){ size(640, 640); noCursor(); noStroke(); particles = new ArrayList<Particle>(); background(0); } void draw(){ fill(0,</particle></particle>…

マウスでエネルギーを与えることができるパーティクル

/** * energizable particles * * @author aa_debdeb * @date 2016/11/27 */ ArrayList<Particle> particles; color c1 = color(79, 208, 255); color c2 = color(255, 127, 80); void setup(){ size(640, 640); particles = new ArrayList<Particle>(); for(int i = 0; i < 15; </particle></particle>…

溢れるパーティクル

/** * spilled particles * * @author aa_debdeb * @date 2016/11/26 */ float MAX_VEL = 15; float MAX_SIZE = 10.0; float GRAVITY = 1.0; ArrayList<Particle> particles; void setup(){ size(640, 640); particles = new ArrayList<Particle>(); } void draw(){ fill(0, 100)</particle></particle>…

マウスクリックに応じて現れたり消えたりする円

/** * fade in / fade out * * @author aa_debdeb * @date 2016/11/21 */ boolean canShowCircles = true; boolean isAnimating = false; int duration = 100; int animatingTime = 0; ArrayList<Circle> circles; color c1, c2; void setup(){ size(640, 640); circ</circle>…

イージングで飛び出る円

/** * easing test * * @author aa_debdeb * @date 2016/11/20 */ float time = 0; float duration = 200; ArrayList<Circle> circles; color c1, c2; void setup(){ size(640, 640); mousePressed(); } void draw(){ translate(width / 2, height / 2); background(</circle>…

柔らかいタワー

/** * soft towers * * @author aa_debdeb * @date 2016/11/19 */ ArrayList<Tower> towers; float towerWidth = 25; float minHeight = 0; float maxHeight = 400; float maxAcc = 50; void setup(){ size(500, 500, P3D); towers = new ArrayList<Tower>(); for(float w </tower></tower>…

3D空間を飛んで移動する

flying in 3D world - OpenProcessing /** * flying in 3D world * * @author aa_debdeb * @date 2016/11/12 */ Camera cam; ArrayList<Block> blocks; void setup(){ size(640, 640, P3D); noStroke(); blocks = new ArrayList<Block>(); for(int i = 0; i < 150; i++){ b</block></block>…

無限の流れ

endless stream - OpenProcessing /** * endless stream * * @author aa_debdeb * @date 2016/1019 */ float MAX_SPEED = 20; float MIN_SPEED = 5; ArrayList<Rectangle> rectangles; float speed; float distance; float rectWNoise = random(10000); float rectHNois</rectangle>…

万華鏡

/** * kaleidoscope * * @author aa_debdeb * @date 2016/10/04 */ void setup(){ size(640, 640); colorMode(HSB, 360, 100, 100); background(0, 0, 0); noFill(); } void draw(){ translate(width / 2, height / 2); if(mousePressed){ PVector mouse = n…

多層の正方形

/** * multi-layered squares * * @author aa_debdeb * @date 2016/09/24 */ int num = 40; void setup(){ size(500, 500); rectMode(CENTER); strokeWeight(1); } void draw(){ background(240); for(int i = 0; i <= num; i++){ stroke(240); fill(30); fl…

マウスクリックに反応して移動する円

/** * rotating circles * * @author aa_debdeb * @date 2016/09/20 */ float r = 200; int num = 20; ArrayList<Particle> particles; boolean isMoving; int startTime, endTime; void setup(){ size(640, 640); particles = new ArrayList<Particle>(); float angStep = TWO_P</particle></particle>…

サイバーな花火

/** * 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>…

似非流体

/** * 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>…

波の干渉

/** * 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…

巻き取れる格子

「c」で回転方向の切り替え。 /** * winding lattice * * @author aa_debdeb * @date 2016/07/28 * * press "c" to toggle the direction of rotation * */ int sampleStep = 2; int lineStep = 10; boolean clockwise = true; PVector[][] points; void set…

マウスを中心にオブジェクトを回転させる

/** * force for rotation * * @author aa_debdeb * @date 2016/07/27 */ ArrayList<PVector> particles; void setup(){ size(500, 500); noStroke(); fill(255, 255, 0, 200); particles = new ArrayList<PVector>(); for(int i = 0; i < 3000; i++){ float radious = map(sqr</pvector></pvector>…

海底探査

/** * seabed exploration * * @author aa_debdeb * @date 2016/07/15 */ float maxLocRadious = 800; float minSize = 10; float maxSize = 100; float noiseX = random(10000); float noiseY = random(10000); float noiseScale = 0.02; float camSpeed = …

マウスで線で表された空間をグニャグニャにする

/** * force by mouse to lines * * @author aa_debdeb * @date 2016/07/12 */ int X_STEP = 1; int Y_STEP = 5; int X, Y; float FORCE_RADIOUS = 100; float MAX_FORCE = 5.0; PVector[][] points; void setup(){ size(500, 500); stroke(255, 128); noFil…

円状の虹

/** * rainbow spin * * @author aa_debdeb * @date 2016/07/07 */ float R = 220; float angleStep = 24; void setup(){ size(500, 500); stroke(0); strokeWeight(3); } void draw(){ colorMode(RGB, 255); background(255); colorMode(HSB, 360, 100, 100…

球の中心にあるカメラ

/** * camera in sphere * * @author aa_debdeb * @date 2016/05/14 */ ArrayList<PVector> points; void setup(){ size(500, 500, P3D); points = new ArrayList<PVector>(); float r = width / 2; for(int i = 0; i < 300; i++){ float radian1 = random(PI / 2); float radi</pvector></pvector>…

スペース・トラベル

/** * space travel * * @author aa_debdeb * @date 2016/05/10 */ ArrayList<Star> stars; float speed; float maxSpeed = 3.0; float speedStep = 0.01; void setup(){ size(640, 480); stars = new ArrayList<Star>(); for(int i = 0; i < 200; i++){ stars.add(new S</star></star>…

弧の間隔が変わらない渦

/** * circular eyes * * @author aa_debdeb * @date 2016/05/02 */ void setup(){ size(500, 500); noStroke(); } void draw(){ background(64); translate(width / 2, height / 2); float radian = 0.0; float radious = 10.0; while(radious <= width){ r…

サイケデリック・スタンプ

/** * psychedelic stamps * * @author aa_debdeb * @date 2016/04/25 */ void setup(){ size(640, 640); background(255); colorMode(HSB, 360, 100, 100); noStroke(); } void draw(){ if(mousePressed){ float diameter = sqrt(sq(pmouseX - mouseX) - sq…

3Dのボックスをマウスの動きに合わせて回転させる

/** * rotating boxes * * @author aa_debdeb * @date 2016/04/10 */ void setup(){ size(500, 500, P3D); } void draw(){ background(64); lights(); for(float w = 0; w <= width; w += 50){ for(float h = 0; h <= height; h += 50){ pushMatrix(); trans…

円から産まれるパーティクル

/** * particles from eggs * * @author aa_debdeb * @date 2016/04/07 */ float P_RADIOUS = 7; float radious; ArrayList<Particle> particles; void setup(){ size(500, 500); noStroke(); radious = 0; particles = new ArrayList<Particle>(); } void draw(){ background(#F</particle></particle>…

成長

/** * growth * * @author aa_debdeb * @date 2016/04/06 */ ArrayList<Bubble> bubbles; void setup(){ size(640, 480); background(255); fill(255); stroke(0); bubbles = new ArrayList<Bubble>(); } void draw(){ PVector target = new PVector(mouseX, mouseY); for(Bu</bubble></bubble>…

重なる市松模様

/** * overlayed checks * * @author aa_debdeb * @date 2016/03/26 */ int CELL_NUM = 200; int CELL_SIZE = 10; void setup(){ size(640, 640); noStroke(); background(255); } void draw(){ translate(mouseX, mouseY); rotate(frameCount * 0.05); for(…

カラールーレット

/** * color roulette * * @author aa_debdeb * @date 2016/03/13 */ void setup(){ size(640, 640); frameRate(60); strokeWeight(2); background(0); colorMode(HSB, 360, 100, 100); } void draw(){ if(mousePressed){ translate(mouseX, mouseY); rotate…

回転する三角形のスタンプ

/** * rotating triangle stamp * * @author aa_debdeb * @date 2016/03/08 */ void setup(){ size(640, 640); background(30); fill(0); stroke(255); strokeWeight(1); } void draw(){ if(mousePressed){ translate(mouseX, mouseY); rotate(frameCount * …

パーティクルの流れ

/** * Noisy Flow for Particles * * @author aa_debdeb * @date 2016/03/04 */ ArrayList<Particle> particles; void setup(){ size(640, 640); particles = new ArrayList<Particle>(); for(int i = 0; i < 1000; i++){ particles.add(new Particle()); } background(255); str</particle></particle>…

網目

/** * Mesh Net * * @author aa_debdeb * @date 2016/02/24 */ ArrayList<PVector> positions; void setup(){ size(500, 500); frameRate(30); background(0); stroke(255, 100); positions = new ArrayList<PVector>(); } void draw(){ if(mousePressed){ float x = mouseX + </pvector></pvector>…

ずれた格子

/** * Unshaped Lattice * * @author aa_debdeb * @date 2016/02/21 */ float noiseX, noiseY; void setup(){ size(500, 500); smooth(); mousePressed(); } void draw(){ } void mousePressed(){ color bgColor = color(random(255), random(255), random(2…

トゲトゲの円

/** * Unshaped Circle * * @author aa_debdeb * @date 2016/02/03 */ void setup(){ size(500, 500); noFill(); mouseMoved(); } void draw(){ } void mouseMoved(){ background(255); beginShape(); float angStep = map(mouseX, 0, width, 30, 1); float …

ペンキをとばす

マウスをクリックする。 /** * Paint Splash * * @author aa_debdeb * @date 2016/01/19 */ void setup(){ size(500, 500); background(255); frameRate(30); colorMode(HSB, 360, 100, 100); } void draw(){ } void mousePressed(){ pushMatrix(); translat…

円でマウスを追いかける

/** * Mouse Followers * * @author aa_debdeb * @date 2016/01/18 */ ArrayList<PVector> pastMouses; void setup(){ size(500, 500); smooth(); frameRate(30); pastMouses = new ArrayList<PVector>(); } void draw(){ background(128, 11, 35); stroke(230, 195, 0); strok</pvector></pvector>…

円で多角形

/** * Polygonal Shape * * @author aa_debdeb * @date 2016/11/14 */ int circleNum = 75; float radious = 180; void setup(){ size(500, 500); frameRate(30); } void draw(){ background(165, 42, 42); translate(width / 2, height / 2); rotate(frameC…