Does this run smoothly for larger rectangles, ive tried this in p5.js and it was not cpu friendly. Its fine if noLoop() is usdd but then i couldnt use the function for filling rotating 3d shapes, as they did require loop. Perhaps its different in Processing.
Does this run smoothly for larger rectangles, ive tried this in p5.js and it was not cpu friendly. Its fine if noLoop() is usdd but then i couldnt use the function for filling rotating 3d shapes, as they did require loop. Perhaps its different in Processing.
You can fill a rotated shape while using noLoop, but you can’t animate it (it won’t move) (unless you call redraw from input events, see below). Without loop, no animation. Also, a rectangle is not a 3D shape – although you can draw them in both 2D and 3D renderers. Rectangle size probably shouldn’t matter. Rectangle count should matter. If you have 100,000 rectangles, PShape (in Java mode) is really inefficient compared to a non-object based approach. If your view isn’t changing, the most efficient thing is to render once to PGraphics or the canvas, then reuse that pre-rendered image.
re:CPU friendly: p5.js and Processing(Java) are implemented in different languages, so different things may be fast or slow. You usually need to test or optimize separately depending on the language mode you are using. What specifically are you trying to do?