-
Notifications
You must be signed in to change notification settings - Fork 0
/
parametric_column.pde
133 lines (106 loc) · 2.52 KB
/
parametric_column.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
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
int baseHeight = 30;
int shaftHeight = 300;
int capitalHeight = 30;
int diameterLow = 40;
int diameterHigh = 30;
// change rate
int rate = 8;
void setup(){
ellipseMode(CENTER);
size(800, 800);
smooth();
}
void draw(){
draw_column(width/2, height/2, baseHeight, shaftHeight, capitalHeight, diameterLow, diameterHigh);
}
void draw_column(int x, int y, int bH, int sH, int cH, int dL, int dH){
background(255);
noFill();
stroke(0);
strokeWeight(0.5);
// construction points
//ellipse(x, y, 15, 15); // center point marker
/*
line(x, y, x+5, y+5);
line(x, y, x-5, y+5);
line(x, y, x-5, y-5);
line(x, y, x+5, y-5);
// capital - draws circles at the corner points of the capital
ellipse(x-(dH/2), y-(sH/2), 10, 10);
ellipse(x+(dH/2), y-(sH/2), 10, 10);
ellipse(x+(dH/2) + (dH*0.3), 1.0*(y - ((sH/2)+cH)), 10, 10);
ellipse(x-((dH/2) + (dH*0.3)), y - ((sH/2)+cH), 10, 10);
// base
ellipse(x-(dL/2)-(dL*0.3), y + (sH/2) +bH, 10, 10);
ellipse(x+(dL/2)+(dL*0.3), y + (sH/2) + bH, 10, 10);
ellipse(x + (dL/2), y + (sH/2), 10, 10);
ellipse(x - (dL/2), y + (sH/2), 10, 10);
*/
strokeWeight(1);
//draw capitel
quad(x-(dH/2), y-(sH/2), x+(dH/2), y-(sH/2), x+(dH/2) + (dH*0.3), 1.0*(y - ((sH/2)+cH)), x-((dH/2) + (dH*0.3)), y - ((sH/2)+cH));
// shaft
quad(x-(dL/2), y + (sH/2), x +(dL/2), y + (sH/2), x + (dH/2), y - (sH/2), x - (dH/2), y - (sH/2));
// base
quad(x-(dL/2)-(dL*0.3), y + (sH/2) +bH, x+(dL/2)+(dL*0.3), y + (sH/2) + bH, x + (dL/2), y + (sH/2), x - (dL/2), y + (sH/2));
}
void keyPressed(){
// change column dimensions
if (key == CODED){
if (keyCode == UP){
shaftHeight += rate;
}
if (keyCode == DOWN){
shaftHeight -= rate;
}
if (keyCode == LEFT){
diameterLow -= rate;
}
if (keyCode == RIGHT){
diameterLow += rate;
}
}
if (key == 'w'){
diameterHigh += rate;
}
if (key == 's'){
diameterHigh-= rate;
}
if (key == 'q'){
capitalHeight += rate;
}
if (key == 'a'){
capitalHeight -= rate;
}
if (key == 'e'){
if (baseHeight <= (height - 100)){
baseHeight += rate;
}
}
if (key == 'd'){
if (baseHeight >= 10){
baseHeight -= rate;
}
}
if (key=='1') {
save("vern1.jpg");
}
if (key=='2') {
save("vern2.jpg");
}
if (key=='3') {
save("vern3.jpg");
}
if (key=='4') {
save("vern4.jpg");
}
if (key=='5') {
save("vern5.jpg");
}
if (key=='6') {
save("vern6.jpg");
}
if (key=='7') {
save("vern7.jpg");
}
}