xxxxxxxxxx
var ps;
var pressed = 0;
var dx,dy;
var _x,_y;
var iter_nx;
var iter_ny;
var iter_nz;
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
var point = createVector(random(0,width),random(0,height/2+10));
ps = new ParticleSystem(point.x,point.y);
_x = random(0,width);
_y = random(0,height);
iter_nx = 0;
iter_ny = 10;
}
function draw() {
//blendMode(BLEND);
/*
blendMode(BLEND);
fill(0, 7);
rect(0, 0, width, height);
*/
blendMode(ADD);
if(frameCount%120 == 0){
ps.initColor();
ps.initOrigin(_x, _y);
//_x = random(0,width);
//_y = random(0,height/2+10);
_x *= -1;
_y *= -1;
}
var gravity = createVector(random(1,100)/10-10/2,random(1,100)/10-10/2);
gravity.x = (noise(iter_nx,iter_nz)-0.5)*2;
gravity.y = (noise(iter_ny,iter_nz)-0.5)*2;
ps.applyForce(gravity.x,gravity.y);
ps.addParticle();
ps.run();
iter_nx += 0.01;
iter_ny += 0.05;
iter_nz += 0.7;
}
function mouseClicked(){
clear();
//blendMode(BLEND);
background(0);
_x = random(0,width);
_y = random(0,height);
}