animation is not responding to increased frameRate
in
Core Library Questions
•
9 months ago
Hi, I have the following code and the animation doesn't seem to respond to the variation of frameRate.
Is this related to the use of PeasyCam library?
Thanks in advance!
Is this related to the use of PeasyCam library?
Thanks in advance!
- import peasy.*; // camera library
PeasyCam cam;
int shift = 0;
PShape s1,s2,s3;
void setup(){
size(1000,1000,P3D);
smooth(8);
frameRate(60);
cam = new PeasyCam(this, 1000);
s1 = createShape(RECT, 0,0, 300,-300);
s1.fill(255,0,0);
s1.end();
s2 = createShape(RECT, 0,0, 300,-300);
s2.fill(0,255,0);
s2.end();
s3 = createShape(RECT, 0,0, 300,-300);
s3.fill(0,0,255);
s3.end();
}
void draw(){
background(0);
smooth(8);
pushMatrix();
translate(0,0,shift);
shape(s1, 0,0);
popMatrix();
pushMatrix();
translate(shift,0,0);
rotateY(PI/(-2));
shape(s2, 0,0);
popMatrix();
pushMatrix();
translate(0,-shift,0);
rotateX(PI/(-2));
shape(s3, 0,0);
popMatrix();
shift += 1;
if (shift>300){shift=0;}
}
1