import ddf.minim.signals.*; import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; int WIDTH = 900; int HEIGHT = 600; int numStars = 50; float intialSpeed = 0.25; float gravScaler = 0.0001; float gravFalloff = 8; float drag = 0.125; float[] xPos = new float[numStars]; float[] yPos = new float[numStars]; float[] newXPos = new float[numStars]; float[] newYPos = new float[numStars]; float[] mass = new float[numStars]; float[] xVel = new float[numStars]; float[] yVel = new float[numStars]; color[] starCol = new color[numStars]; int blurCounter = 0; float entropy = 0.9999; void setup() { size(900,600); buildWorld(); smooth(); background(0); noStroke(); } void draw(){ // background(0); moveStars(); drawStars(); } void moveStars(){ int i; int j; for(i=0;i 1 || abs(yVel[i]) > 1){ xPos[i] = random(WIDTH); yPos[i] = random(HEIGHT); newXPos[i] = xPos[i]; newYPos[i] = yPos[i]; float rand = random(6)+1; mass[i] = pow(rand,(1.0/1.1)); xVel[i] = (random(2)-1)*intialSpeed; yVel[i] = (random(2)-1)*intialSpeed; starCol[i] = color (random(64)+64,random(64)+128,random(128)+128); if(i<10){ mass[i] = random(20)+10; xVel[i] = (random(2)-1)*intialSpeed*0.04; yVel[i] = (random(2)-1)*intialSpeed*0.04; starCol[i] = color (random(128)+128,random(128),random(64)); } } } } void drawStars(){ int i; for(i=1;i 10){ float wobble = noise(xPos[i],yPos[i])*2; float wobble2 = noise(newXPos[i],newYPos[i])*3; ellipse(xPos[i]+wobble,yPos[i]+wobble,mass[i]*velVec,mass[i]*velVec); }else{ float extraScale = noise(xPos[i],yPos[i])*3; ellipse(xPos[i],yPos[i],mass[i]*velVec*2+extraScale,mass[i]*velVec*2+extraScale); } xPos[i] = newXPos[i]; yPos[i] = newYPos[i]; if(xPos[i]>WIDTH){ xPos[i] = xPos[i] - WIDTH; } if(yPos[i]>HEIGHT){ yPos[i] = yPos[i] - HEIGHT; } if(xPos[i]<0){ xPos[i] = xPos[i] + WIDTH; } if(yPos[i]<0){ yPos[i] = yPos[i] + HEIGHT; } } if(blurCounter>25000){ // filter(BLUR, 1); blurCounter = 0; } blurCounter += 1; } float lengthVec(float x1, float y1, float x2, float y2){ float outLength = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ); return outLength; } void buildWorld(){ int i; for(i=0;i