Open clankill3r opened 4 months ago
The difference between scale(1.999999); and scale(2); in the sketch below is that with scale(2); there is a frameRate drop of around 50fps!
scale(1.999999);
scale(2);
P2D
P3D
void setup() { size(600, 600, P2D); } void draw() { background(0); pushMatrix(); //scale(1.999999); scale(2); draw_recursive(50, 50, width-50, height-50, 0, 7); popMatrix(); fill(255); text(""+(int)frameRate, 10, 14); } void draw_recursive(float x1, float y1, float x2, float y2, int level, int max_level) { if (level < max_level) { float cx = x1 + (x2 - x1) / 2; float cy = y1 + (y2 - y1) / 2; draw_recursive(x1, y1, cx, cy, level+1, max_level); draw_recursive(cx, y1, x2, cy, level+1, max_level); draw_recursive(x1, cy, cx, y2, level+1, max_level); draw_recursive(cx, cy, x2, y2, level+1, max_level); } else { fill(255, 255, 0); stroke(0); strokeWeight(1); rectMode(CORNERS); rect(x1, y1, x2, y2); } }
The difference between
scale(1.999999);
andscale(2);
in the sketch below is that withscale(2);
there is a frameRate drop of around 50fps!P2D
(to be extra clear, so not inP3D
!).