class Thingy { private PVector last_loc; public PVector loc; public PVector acc; public PVector vel; public float mass; float grayscale = 0; float rv; float gv; float bv; float hv; float sv; float lv; float strokeW = 1; boolean dark = false; Thingy() { this.acc = new PVector(0,0); this.vel = new PVector(0,0); this.loc = new PVector(0,0); this.last_loc = new PVector(0,0); this.mass = 0; this.strokeW = 1; } Thingy(PVector initial_loc) { this.acc = new PVector(0,0); this.vel = new PVector(0,0); this.loc = initial_loc.get(); this.last_loc = initial_loc.get(); this.mass = random(0,1) * 1000 + 700; println("mass:" + this.mass); this.grayscale = 255;//map(random(1,5),1,5,0,255); if (back > 120) { dark = random(0,1) > 0.67; } else { dark = random(0,1) > 0.33; } if (dark) { rv = random(0,60); gv = random(0,60); bv = random(0,60); hv = random(0,360); sv = random(0,180); lv = random(0,180); } else { rv = random(120,255); gv = random(120,255); bv = random(120,255); hv = random(0,360); sv = random(180,360); lv = random(180,360); } } void applyForce(PVector force) { force.div(this.mass); this.acc.add(force); } void update() { this.vel.add(this.acc); this.loc.add(this.vel); //println(this.acc.mag()); } void display() { //stroke(30); //noFill(); //line(width/2, height/2, width/2 + this.acc.x * 100, height/2 + this.acc.y * 100); //line(this.loc.x, this.loc.y, this.loc.x + this.acc.x * 100, this.loc.y + this.acc.y * 100); /* noStroke(); fill(255,0,0); ellipseMode(CENTER); ellipse(this.loc.x,this.loc.y,1,1); */ //stroke(grayscale,20); /* if (dark) { stroke(rv,gv,bv,80); } else { stroke(rv,gv,bv,15); }*/ colorMode(HSB,360,360,360,100); stroke(hv,sv,lv,20); colorMode(RGB,255,255,255,100); if (!fix_stroke) { if (random(0,1) > 0.505) { if (strokeW < 10) { strokeW += 0.1; } } else if (strokeW > 0.1) { strokeW -= 0.1; } } strokeWeight(strokeW); line(this.loc.x,this.loc.y, this.last_loc.x, this.last_loc.y); this.last_loc = this.loc.get(); this.acc.mult(0); } }