Can you guys try this? (try changing the size() on your computers)
boolean rectOrPoint;
void setup() {
size(600, 300); //play with these: make those bigger if you've got a fast modern computer
rectOrPoint = false;
println(rectOrPoint ? "rect(x, y, 1, 1);" : "point(x, y);");
}
void draw() {
for (int j=0; j<height; j++) {
for (int i=0; i<width; i++) {
if (rectOrPoint) {
fill(random(255), random(255), random(255));
noStroke();
rect(i, j, 1, 1);
} else {
noFill();
stroke(random(255), random(255), random(255));
point(i, j);
}
}
}
surface.setTitle((rectOrPoint ? "rect(x, y, 1, 1);" : "point(x, y);")+" @ "+round(frameRate));
}
void keyPressed() {
rectOrPoint = !rectOrPoint;
println(rectOrPoint ? "rect(x, y, 1, 1);" : "point(x, y);");
}
Well, the rect() is almost tenfold faster than the point() (yeah, my computer is that slow but maybe there’s more to it than meets the eye)
I’m raising it as it’s against my expectations what ever could be simplier than painting a pixel with a color? a single assignment instruction! I mean opposite to arranging a rectangular with two nested loops along its hight and width, even if the rectangular is 1×1 pixel wide and high? that confuses me
Is this known? Is this an issue?