Any way to speed up the drawing of ellipses?
in
Programming Questions
•
2 years ago
Hi all,
I'm working on a project where I need to be able to show a large number of nodes (on the order of 10000) moving around in 2-dimensional space. I'm running into some problems achieving a decent frame rate though when drawing each node using an ellipse.
As the simplest possible example, consider the following piece of code:
int frameCount = 0;
void setup() {
}
void draw() {
for (int i=0; i <= 14000; i++) {
ellipse(5,5,5,5);
}
frameCount += 1;
println("" + frameCount);
}
On a 2011 Macbook Pro (i5 processor) I can only get on the order of 5 frames per second running this minimal piece of code. Can anyone suggest any ways to speed up the drawing process, or is this a limitation I'm pretty much stuck with?
I'm working on a project where I need to be able to show a large number of nodes (on the order of 10000) moving around in 2-dimensional space. I'm running into some problems achieving a decent frame rate though when drawing each node using an ellipse.
As the simplest possible example, consider the following piece of code:
int frameCount = 0;
void setup() {
}
void draw() {
for (int i=0; i <= 14000; i++) {
ellipse(5,5,5,5);
}
frameCount += 1;
println("" + frameCount);
}
On a 2011 Macbook Pro (i5 processor) I can only get on the order of 5 frames per second running this minimal piece of code. Can anyone suggest any ways to speed up the drawing process, or is this a limitation I'm pretty much stuck with?
1