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

30 min. Processing

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

パーティクル同士の衝突と反射(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…

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

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

円の中での反射

/** * Reflection in Circle * * @author aa_debdeb * @date 2016/01/24 * */ float lradious = 200; float sradious = 5; ArrayList<Particle> particles; void setup(){ size(500, 500); frameRate(30); smooth(); particles = new ArrayList<Particle>(); for(int i = 0; i < </particle></particle>…

ばね

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