thank you! ..ok, the pronciple;
- global color array
- in setup (because want it only once) generating the random colors from map and storing them into array
doing this by for structure to have each line with different color
- calling them up within the draw() function
(e++ does a good dense line structure too, even when its not that easy for fine tuning)
beginners code not working:
Code:import processing.video.*;
MovieMaker mm;
float e,x,t,d;
PImage a;
// declare global cols array
int paint;
color[] cols = new color[paint];
void setup(){
size(1280,720);
background(255);
smooth();
a = loadImage("15.jpg");
frameRate(25);
mm = new MovieMaker(this, width, height, "001.avi",25, MovieMaker.SORENSON, MovieMaker.BEST);
//for(e=1;e<900;e/=.998){
for(e=1;e<900;e++){
int xx = int(random(a.width));
int yy = int(random(a.height));
// storing colors into array ????
color cols = a.get(xx, yy);
}
}
void draw(){
beginShape();
strokeWeight(0.01*e);
//getting colors out of array ???
stroke(paint,e/4);
for(;x<8;x+=.1,curveVertex(x*400,e+e*noise(x,t+e/60)/8));
endShape();
t+=x=1E-8;
mm.addFrame();
}
void keyPressed() {
if (key == ' ') {
mm.finish();
exit();
}
}