int numVecX = 40; int numVecY = 40; Thing[] things; color[] colors; int frame; void setup() { size(400,400, P3D); PImage img = loadImage("col.png"); img.loadPixels(); colors = img.pixels; frame = 0; background(255,255,255); things = new Thing[numVecX*numVecY]; for (int y=0; y=0 && pmouseX=0 && pmouseYlim) rot = lim; if (rot<-lim) rot = -lim; } void update() { v.x = newV.x; v.y = newV.y; float s = abs(rot); if (s>lim) s=lim; int c = (int) (255-(s/lim)*255); fill(255,c,c,10); s = (s/lim)*40+3; if (mousePressed) { ellipseMode(CENTER); noStroke(); ellipse(posX,posY,s, s); } c = 64+(int) ((abs(rot)/lim)*191); // stroke(c,c,c,(int) ((abs(rot)/lim)*40)+40); if (energy >= colors.length) energy = colors.length-1; energy *= 0.995; int col = colors[(int) (energy)]; stroke( red(col), green(col), blue(col), ((int) ((abs(rot)/lim)*40)+40) ); s = ((abs(rot)/lim)*65+5); line(posX, posY, posX+(int) (v.x*s), posY+(int) (v.y*s)); } } void keyReleased() { if (key==' ') { background(255,255,255); for (int i=0; i