-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjetTable.pde
74 lines (72 loc) · 3.07 KB
/
ObjetTable.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
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
class ObjetTable extends Objet {
ObjetTable (PVector pos, PVector taille, float epaisseurTable, float epaisseurPied) {
pos.add(0, taille.y, 0);
// Planche
add(new Partie(
new PVector(0, 0, 0).add(pos),
new PVector(taille.x, epaisseurTable, taille.z)));
// Pied
add(new Partie(
new PVector(0, - epaisseurTable, 0).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied)));
add(new Partie(
new PVector(taille.x - epaisseurPied, - epaisseurTable, 0).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied)));
add(new Partie(
new PVector(0, - epaisseurTable, taille.z - epaisseurPied).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied)));
add(new Partie(
new PVector(taille.x - epaisseurPied, - epaisseurTable, taille.z - epaisseurPied).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied)));
}
ObjetTable (PVector pos, PVector taille, float epaisseurTable, float epaisseurPied, color[] couleur) {
pos.add(0, taille.y, 0);
// Planche
add(new Partie(
new PVector(0, 0, 0).add(pos),
new PVector(taille.x, epaisseurTable, taille.z),
couleur[0]));
// Pied
add(new Partie(
new PVector(0, - epaisseurTable, 0).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
couleur[1]));
add(new Partie(
new PVector(taille.x - epaisseurPied, - epaisseurTable, 0).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
couleur[2]));
add(new Partie(
new PVector(0, - epaisseurTable, taille.z - epaisseurPied).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
couleur[3]));
add(new Partie(
new PVector(taille.x - epaisseurPied, - epaisseurTable, taille.z - epaisseurPied).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
couleur[4]));
}
ObjetTable (PVector pos, PVector taille, float epaisseurTable, float epaisseurPied, PImage[] texture) {
pos.add(0, taille.y, 0);
// Planche
add(new Partie(
new PVector(0, 0, 0).add(pos),
new PVector(taille.x, epaisseurTable, taille.z),
texture[0]));
// Pied
add(new Partie(
new PVector(0, - epaisseurTable, 0).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
texture[1]));
add(new Partie(
new PVector(taille.x - epaisseurPied, - epaisseurTable, 0).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
texture[2]));
add(new Partie(
new PVector(0, - epaisseurTable, taille.z - epaisseurPied).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
texture[3]));
add(new Partie(
new PVector(taille.x - epaisseurPied, - epaisseurTable, taille.z - epaisseurPied).add(pos),
new PVector(epaisseurPied, taille.y - epaisseurTable, epaisseurPied),
texture[4]));
}
}