strange! i don't know which kind of monitor do u have but the difference between white and the light grey i obtain is quite small.
anyway, here is the code (taken from a openprocessing sketch and modified):
---
import processing.video.*;
MovieMaker mm;
color[][] clre;
PVector[][] posizioni;
PVector origin;
ArrayList particles = new ArrayList();
int numParticles = 36000;
int z = 0;
void setup()
{
size(500, 500);
colorMode(HSB, 360, 100, 100, 100);
clre = new color[width][height];
posizioni = new PVector[width][height];
mm = new MovieMaker(this, width, height, "drawing1.mov", 30, MovieMaker.VIDEO, MovieMaker.LOSSLESS);
}
void draw()
{
background(0, 0, 100);
noStroke();
fill(0, 100, 100, 1);
pushMatrix();
translate(230, 0);
beginShape();
vertex(100, 200);
bezierVertex(45, 200, 0, 155, 0, 100);
vertex(0, 100);
bezierVertex(0, 45, 45, 0, 100, 0);
vertex(100, 0);
bezierVertex(136, 0, 169, 19, 185, 48);
vertex (142, 72);
bezierVertex(133, 60, 117, 50, 100, 50);
vertex(100, 50);
bezierVertex(73, 50, 50, 73, 50, 100);
vertex(50, 100);
bezierVertex(50, 127, 73, 150, 100, 150);
vertex(100, 150);
bezierVertex(117, 150, 133, 140, 142, 129);
vertex(185, 152);
bezierVertex(169, 181, 136, 200, 100, 200);
endShape();
popMatrix();
beginShape();
vertex(0, 195);
vertex(113, 0);
vertex(225, 195);
vertex(168, 195);
vertex(113, 100);
vertex(58, 195);
vertex(0, 195);
endShape();
//beginRecord(PDF, "portfolio.pdf");
for(int i=0; i<width; i++) {
for(int j = 0; j<height; j++) {
clre[i][j] = get(i,j);
if(clre[i][j] != -1){
if(z < numParticles){
posizioni[i][j] = new PVector(i,j,0);
origin = new PVector(35+posizioni[i][j].x, 130+posizioni[i][j].y, 0);
PVector a = new PVector();
PVector v = new PVector();
PVector l = new PVector(random(width), random(height) , 0);
particles.add(new Particle(a,v,l, origin, random(0.05f, 2.0f)));
z++;
}
}
}
}
for (int h = 0; h<particles.size()-1; h++){
Particle prt = (Particle) particles.get(h);
prt.run();
PVector actualVel = prt.getVelocity();
PVector attrito = PVector.mult(actualVel,-0.05);
prt.add_force(attrito);
if(keyPressed) {
if (key == 'a' || key == 'A')
{
PVector origLoc = prt.getOrigin();
PVector diff = PVector.sub(origLoc,prt.getLocation());
diff.normalize();
float factor = 0.5f;
diff.mult(factor);
prt.setAcceleration(diff);
}
if (key == ' ' || key == ' ')
{
mm.finish();
}
}
if(mousePressed) {
PVector mouseLoc = new PVector(mouseX, mouseY, 0);
PVector diff = PVector.sub(mouseLoc,prt.getLocation());
diff.normalize();
float factor = 1.0f;
diff.mult(factor);
prt.setAcceleration(diff);
}
}
mm.addFrame();
}
void keyPressed(){
if (key == 'q' || key == 'Q') {
//endRecord();
exit();
}
}
class Particle {
PVector or;
PVector loc;
PVector vel;
PVector acc;
float ms;
float distance;
Particle(PVector a, PVector v, PVector l, PVector o, float ms_) {
acc = a;
vel = v;
loc = l;
ms = ms_;
or = o;
}
void run() {
update();
render();
}
void update() {
vel.add(acc);
loc.add(vel);
acc = new PVector();
}
void render() {
stroke(1, 100, 0);
point(loc.x,loc.y);
//noStroke();
//fill(204, 102, 0);
//ellipse(loc.x, loc.y, 1, 1);
//stroke(360, 80, 50);
//line(loc.x-1, loc.y-1, loc.x, loc.y);
}
void add_force(PVector force) {
force.div(ms);
vel.add(force);
}
float getMass() {
return ms;
}
PVector getLocation() {
return loc;
}
PVector getOrigin() {
return or;
}
PVector getVelocity() {
return vel;
}
void setLocation(PVector l){
loc = l;
}
void setAcceleration(PVector a){
acc = a;
}
}