-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
200 lines (154 loc) · 5.13 KB
/
index.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<head>
<title>Concrete Choreography.js</title>
<style>
body {margin: 0; padding: 0; overflow: hidden}
.head {position: fixed; font-size: 25px}
.dg.main .close-button {
background-color: rgb(255, 0, 255);
}
.ui {
position : fixed;
display: inline-block;
margin: 0.5em 0.5em 0.5em 0.5em;
border-radius:0.12em;
border: 0.1em solid #FFFFFF;
color: white;
background: transparent;
padding: 0.35em 1.2em;
text-align: center;
box-sizing: border-box;
text-decoration:none;
font-family:'Roboto',sans-serif;
font-weight:300;
font-size: 0.9em;
cursor: pointer;
}
.links {
position : fixed;
display: inline-block;
margin: 0.5em 0.5em 0.5em 0.5em;
border-radius:0.12em;
border: 0.1em solid rgb(0, 0, 0);
padding: 0.35em 1.2em;
text-align: center;
width: 155px;
height: 56px;
box-sizing: border-box;
text-decoration:none;
font-family:'Roboto',sans-serif;
font-weight:300;
font-size: 0.9em;
cursor: pointer;
background-image:url("assets/textures/dbt_logo_with_text.png");
background-size: 100%;
outline: none;
}
.ui:hover {
color:#000000;
background-color: #FFFFFF;
}
.links:hover {
outline: none;
border: none;
}
.links:change {
outline: none;
border: none;
}
</style>
</head>
<body>
<script id="vertexShaderRaw" type="x-shader/x-vertex">
attribute float curvature;
varying float vCurvature;
void main() {
vec3 p = position;
vec4 modelViewPosition = modelViewMatrix * vec4( p , 1.0 );
gl_Position = projectionMatrix * modelViewPosition;
vCurvature = curvature;
}
</script>
<script id="fragmentShaderRaw" type="x-shader/x-fragment">
varying vec3 vViewPosition;
varying float vCurvature;
uniform float Cmin;
uniform float Cmax;
vec3 hsb2rgb( in vec3 c ){
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),
6.0)-3.0)-1.0,
0.0,
1.0 );
rgb = rgb*rgb*(3.0-2.0*rgb);
return c.z * mix(vec3(1.0), rgb, c.y);
}
void main() {
float range = Cmax - Cmin;
vec3 color = vec3(0.0);
color = hsb2rgb( vec3( range - vCurvature ,1.0, 1.0) );
gl_FragColor = vec4( color, 1.0 );
}
</script>
<script id="vertexShaderOverhang" type="x-shader/x-vertex">
attribute float overhang;
varying float vOverhang;
void main() {
vec3 p = position;
vec4 modelViewPosition = modelViewMatrix * vec4( p , 1.0 );
gl_Position = projectionMatrix * modelViewPosition;
vOverhang = overhang;
}
</script>
<script id="fragmentShaderOverhang" type="x-shader/x-fragment">
varying vec3 vViewPosition;
varying float vOverhang;
uniform float Omin;
uniform float Omax;
vec3 hsb2rgb( in vec3 c ){
vec3 rgb = clamp(abs(mod(c.x * 6.0 + vec3(0.0,4.0,2.0),
6.0)-3.0)-1.0,
0.0,
1.0 );
rgb = rgb*rgb*(3.0-2.0*rgb);
return c.z * mix( vec3(1.0), rgb, c.y);
}
void main() {
vec3 color = vec3(0.0);
float range = Omax - Omin;
color = hsb2rgb( vec3( range - vOverhang , 1.0, 1.0) );
gl_FragColor = vec4( color, 1.0 );
}
</script>
<!-- <div style = "top:10px; width:100%; height:100px; font-weight:200; text-align:center; font-family:'Roboto',sans-serif; color:white;" class="head">DBT Concrete Choreography</div> -->
<button style="top:45px" id="reset" class="ui">RESET</button>
<button style="top:85px" id="rotate" class="ui">ROTATE</button>
<button style="top:125px" id="base" class="ui">BASE</button>
<button style="top:165px" id="mirror" class="ui">MIRROR</button>
<button style="top:205px" id="slice" class="ui">SLICE</button>
<button style="left: 83px; top:205px" id="normals" class="ui">NORMALS</button>
<button style="top:245px" id="exportStl" class="ui">EXPORT</button>
<button style="top:285px" id="concrete" class="ui">PRINT IT</button>
<button style="left: 100px; top:285px" id="curvature" class="ui">CURVATURE</button>
<button style="left: 100px; top:245px" id="overhang" class="ui">OVERHANG</button>
<button style="top:365px" id="extrudepath" class="ui">PRINT PATH </button>
<button style="left: 124px; top:365px" id="snow" class="ui">LET IT SNOW</button>
<button style="top:325px" id="in" class="ui">ZOOM IN</button>
<button style="left: 101px; top:325px" id="out" class="ui">ZOOM OUT</button>
<!-- links to credits -->
<button style="right: 0px; bottom:0px;" id="dbt" class="links" onclick=" window.open('http://dbt.arch.ethz.ch','_blank')"></button>
<script src="lib/three.js"></script>
<script src="lib/BufferGeometryUtils.js" ></script>
<script type="text/javascript" src="lib/CustomGeo.js"></script>
<script type="text/javascript" src="lib/Curvature.js"></script>
<script type="text/javascript" src="lib/Overhang.js"></script>
<script src="lib/stats.js"></script>
<script src="lib/STLExporter.js"></script>
<script src="lib/perlin.js"></script>
<script src="lib/dat.gui.js"></script>
<link type="text/css" rel="stylesheet" href="lib/dat-gui-style.css">
<script src="lib/OrbitControls.js"></script>
<script type="text/javascript" src="lib/PatternCreation.js"></script>
<script src="main.js"></script>
</body>
</html>