Slow Processing Sketches
in
Integration and Hardware
•
2 years ago
Hey everyone, I'm new to processing, and my sketches have been running very slowly. I haven't made a text output of the fps, but I'm guessing its < 10fps. I've got an 8800 gts and 3ghz or so processor (let me know if you need other specs), and I just updated my graphics drivers.
Here's some sample code for me that just drags:
Anyways, I would appreciate any advice on how to fix this. I'm trying to do some homework, and it's annoying trying to design an animation at 2fps.
Thanks :)
Here's some sample code for me that just drags:
- import processing.opengl.*;
int stage = 0;
float x,y,z;
void setup() {
size(800, 800, OPENGL);
noStroke();
x=0;
y=0;
z=0;
}
void draw() {
//clear
resetMatrix();
background(0);
//camera
perspective (PI * 0.333f, 1.0f, 0.01f, 1000.0f);
camera (25, 25, 25,
0, 0, 0,
0.0f, 1.0f, 0.0f);
sphereDetail(10);
translate(x, y , z);
sphere(4);
if(stage == 0)
{
x+=0.5f;
}
else if(stage ==1)
{
x-=0.5f;
}
if(x > 10 && stage == 0)
{
stage = 1;
}
else if(x < -10 && stage == 1)
{
stage = 0;
}
}
Anyways, I would appreciate any advice on how to fix this. I'm trying to do some homework, and it's annoying trying to design an animation at 2fps.
Thanks :)
1