-
Notifications
You must be signed in to change notification settings - Fork 0
/
debord.pjs
135 lines (123 loc) · 4.56 KB
/
debord.pjs
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// Processing.js Example
PImage parBG, db1, db2, db3, db4,db5, db6, db7, db8, db9, db10, db11, db12, db13, db14, db15, db16, db17, db18, db19, db20, db21, db22, db23, db24;
PFont debug;
float RATIO = 2500.0/2656.0;
float FIX = 2500.0/5290.0;
int hAnc, vAnc, nwidth,nheight, aCount,gate1,gate2,gate3;
float factor,xoff,yoff;
boolean animating;
void setup() {
size(800, 800*RATIO);
frameRate(90);
//initalization of misc variables;
factor = 1.0;
hAnc = 0;
vAnc = 0;
aCount = 0;
gate1 = 100;
animating = false;
xoff = 0.0;
yoff = 0.0;
//pictures
parBG = loadImage("data/0dubord2.png");
db1 = requestImage("data/APontNeuf.png");
db2 = requestImage("data/BPontDesArts.png");
db3 = requestImage("data/CRueDauphine.png");
db4 = requestImage("data/DRueSaintSauveur.png");
db5 = requestImage("data/ELouvre.png");
db6 = requestImage("data/Fpalaisroyal.png");
db7 = requestImage("data/Gforumdeshalles.png");
db8 = requestImage("data/HArchives.png");
db9 = requestImage("data/Ipompidou.png");
db10 = requestImage("data/Jblancsmanteaux.png");
db11 = requestImage("data/Kruedesbourdonna.png");
db12 = requestImage("data/Ltemplestmarie.png");
db13 = requestImage("data/Mplacedesvosges.png");
db14 = requestImage("data/Ngaredelarsenal.png");
db15 = requestImage("data/OEglStGervais.png");
db16 = requestImage("data/PQuaiAuxFleurs.png");
db17 = requestImage("data/QCharlemagne.png");
db18 = requestImage("data/RPontSully.png");
db19 = requestImage("data/SRueLagrange.png");
db20 = requestImage("data/TPantheon.png");
db21 = requestImage("data/URueDescartes.png");
db22 = requestImage("data/VFaculteDesSciences.png");
db23 = requestImage("data/WEcoleNormale.png");
db24 = requestImage("data/XRueDeBercy.png");
//System Font
debug = createFont("data/Didot.ttc",16);
}
void draw() {
background(#333333);
nwidth = int(800*factor);
nheight = int(800*factor*RATIO);
float xplace = hAnc*(factor-1.0);
float yplace = vAnc*(factor-1.0);
//float widFactor = 1.0*nwidth/parBG.width*FIX;
//float heiFactor = 1.0*nheight/parBG.height*FIX;
float widFactor = 1.0*nwidth/parBG.width;
float heiFactor = 1.0*nheight/parBG.height;
if(animating && aCount < gate1)
aCount++;
float totx = mouseX/300.0+xoff;
float toty = mouseY/200.0+yoff;
//tint(255,255,255,255-aCount*255.0/gate1);
image(parBG,xplace,yplace,nwidth,nheight);
//noTint();
//tint(255,189,64);
image(db1,xplace+nwidth/5.322,yplace+nheight/2.67,widFactor*db1.width,heiFactor*db1.height);
image(db2,xplace+nwidth/21.25,yplace+nheight/2.885,widFactor*db2.width,heiFactor*db2.height);
image(db3,xplace+nwidth/7.15,yplace+nheight/2.245,widFactor*db3.width,heiFactor*db3.height);
image(db4,xplace+nwidth/3.0,yplace+nheight/14.14,widFactor*db4.width,heiFactor*db4.height);
image(db5,xplace+nwidth/7.64,yplace+nheight/3.83,widFactor*db5.width,heiFactor*db5.height);
image(db6,xplace+nwidth/8.8,yplace+nheight/29.3,widFactor*db6.width,heiFactor*db6.height);
image(db7,xplace+nwidth/4.12,yplace+nheight/6.82,widFactor*db7.width,heiFactor*db7.height);
image(db8,xplace+nwidth/1.645,yplace+nheight/7.3,widFactor*db8.width,heiFactor*db8.height);
image(db9,xplace+nwidth/2.18,yplace+nheight/5.12,widFactor*db9.width,heiFactor*db9.height);
image(db10,xplace+nwidth/1.855,yplace+nheight/3.82,widFactor*db10.width,heiFactor*db10.height);
image(db11,xplace+nwidth/3.52,yplace+nheight/3.16,widFactor*db11.width,heiFactor*db11.height);
image(db12,xplace+nwidth/1.323,yplace+nheight/2.017,widFactor*db12.width,heiFactor*db12.height);
image(db13,xplace+nwidth/1.267,yplace+nheight/2.735,widFactor*db13.width,heiFactor*db13.height);
image(db14,xplace+nwidth/1.347,yplace+nheight/1.855,widFactor*db14.width,heiFactor*db14.height);
image(db15,xplace+nwidth/1.73,yplace+nheight/2.42,widFactor*db15.width,heiFactor*db15.height);
//image(db15,xplace+nwidth/totx,yplace+nheight/toty,widFactor*db15.width,heiFactor*db15.height);
//noTint();
/*image(parBG,0,0,800,800*RATIO);
image(db1,0,0);
image(db2,0,0);
image(db3,0,0);
image(db4,0,0);*/
fill(0,0,0);
textFont(debug);
String s = "HFactor = " + str(totx) + "\nVFactor = " + str(toty);
text(s,50,50,250,100);
}
void mouseClicked(){
if(mouseButton == LEFT){
factor+=.2;
hAnc = int((-1.0*mouseX));
vAnc = int((-1.0*mouseY));
}
if(mouseButton == RIGHT){
hAnc = int((-1.0*mouseX));
vAnc = int((-1.0*mouseY));
}
}
void keyPressed(){
if(key == 'r'){
factor=1.0;
hAnc = 0;
vAnc = 0;
}
if(key == ' '){
animating = !animating;
}
if(key == 'w')
yoff+= .01;
if(key == 'a')
xoff-= .01;
if(key == 'd')
xoff += .01;
if(key == 's')
yoff-=.01;
}