/
plot.pde
49 lines (44 loc) · 907 Bytes
/
plot.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import processing.pdf.*;
boolean bRecordingPDF;
void setup() {
size(1000, 1000);
background(255);
strokeWeight(2);
bRecordingPDF = true;
if (bRecordingPDF) {
beginRecord(PDF, "render.pdf");
}
}
boolean canfreeze = true;
void draw() {
if(canfreeze && millis() > 6770) {
endRecord();
bRecordingPDF = false;
noLoop();
}
float ballR = min(width, height)/3;
float pathR = min(width, height)/3 - ballR/3;
float mDiv = 1000.0;
float t = millis()/mDiv;
float x = width/2.3+pathR*cos(t);
float y = height/2+pathR*sin(t);
for(int i=0; i<3; i++) {
//CHANGE THIS NUM:
float var = 3+i;
fill(0);
mDiv /= 2;
t = millis()/mDiv*var;
pathR = pathR/2;
x = x+pathR*cos(t);
y = y+pathR*sin(t);
point(x,y);
}
}
//void mouseClicked() {
// noLoop();
// saveFrame();
//}
void keyPressed() {
endRecord();
bRecordingPDF = false;
}