the different between static & active modes.
in
Programming Questions
•
1 year ago
I have some confusion with these 2 scripts.
The 1st scipt is only running once (static) & the 2nd one is running continuously (active mode).
they should provide similar result; a line cross at the centre.
However,the result of the 2nd one wan't what I expected.
is there any fundamental error in the script that let me down? many thanks!
1st script
_____________________________________________________________________
import processing.opengl.*;
size(100, 100,OPENGL);
background(0);
scale(width/2,height/2);
translate(1.0,1.0);
stroke(255);
strokeWeight(1.0/width);
line(-1,0,1,0);
line(0,-1,0,1);
2nd script
_____________________________________________________________________
import processing.opengl.*;
void setup()
{
size(100, 100,OPENGL);
background(0);
scale(width/2,height/2);
translate(1.0,1.0);
}
void draw(){
stroke(255);
strokeWeight(1.0/width);
line(-1,0,1,0);
line(0,-1,0,1);
}
1