We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › draw point in for loop
Page Index Toggle Pages: 1
draw point in for loop (Read 190 times)
draw point in for loop
Mar 11th, 2009, 6:19pm
 
hello everybody,

i'm creating a sketch who reads out an image, on several ways.
The thing is that i want to draw its movement.

example:

Code:

void blij_1(){
for(int y = 0; y < test.height;y++){
for(int x = 0; x < (test.width) ;x++){
grab(x,y);
sound(x,y,c);
stroke(255,0,0);
point(x,y);
}
}
}


Code:

void grab(int tx,float ty){
int x = tx;
int y = int(ty);

c = get(x+test.width,y);
h = hue(c);
s = saturation(c);
b = brightness(c);
}

void sound(int tx, float ty, color tc){
int x = tx;
int y = int(ty);
color c = tc;

myWave=new TriangleWave((hue(c))*10,v);
myWave.generate(myChannel,0,myChannel.frames(6000));
delay(20);
myChannel.play();
}


when the loop is done, all the points suddenly appear on the screen. But they need to go one by one.

thanks
Page Index Toggle Pages: 1