-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
291 lines (244 loc) · 10.6 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>FIWARE Demo</title>
<style type="text/css">
html, body {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
overflow: hidden;
}
body {
position: absolute;
background: #222;
top: 0px;
left: 0px;
}
#webtundra-container {
position: absolute;
background-color: green;
width: 100%;
height: 100%;
}
#vizicities-viewport {
width: 100%;
height: 100%;
position: absolute;
display: none;
}
#heatmapContainerWrapper {
pointer-events: none;
width:100%;
height:100%;
position: absolute;
background:rgba(0,0,0,.1);
}
#heatmapContainer {
pointer-events: none;
width:100%;
height:100%;
visibility: hidden;
}
</style>
<link rel="stylesheet" type="text/css" href="build/vizicities/vizi.css">
<!-- includes three.js r69 which is used in this app. -->
<script src="build/vizicities/vizi.js"></script>
<!--Dialog-->
<script src="js/client/jquery-2.1.1.min.js"></script>
<script src="js/client/jquery-ui.js"></script>
<link rel=stylesheet href="css/jquery-ui.css" />
<link rel=stylesheet href="css/info.css"/>
<link rel=stylesheet href="css/startmenu.css"/>
<link rel=stylesheet href="css/tutorialmenu.css"/>
<link rel=stylesheet href="css/infodialog.css"/>
<!-- -->
<!--Camera control-->
<script src="js/client/PanAndOrbitControls.js"></script>
<!-- three using codes here may or may not work - networking should -->
<script src="build/webtundra/lib/loglevel.js"></script>
<script src="build/webtundra/lib/signals.js"></script>
<script src="build/webtundra/lib/jquery.mousewheel.js"></script>
<script src="build/webtundra/lib/jquery.contextmenu.js"></script>
<script src="build/webtundra/lib/three/CSS3DRenderer.js"></script>
<script src="build/webtundra/lib/three/OBJLoader.js"></script>
<script src="build/webtundra/realxtend-webtundra.js"></script>
</head>
<body>
<!-- todo: combine these so that vizi renders with webtundra -->
<div id="webtundra-container"></div>
<div id="vizicities-viewport"></div>
<div id="heatmapContainerWrapper">
<div id="heatmapContainer">
</div>
</div>
<div style="float:right; width:130px; margin-top:15px;">
<button id='startmenu-button' class='ui-button-icons-only'></button>
<button id='tutorialmenu-button' class='ui-button-icons-only'></button>
</div>
<div id="heatmap-bar">
<img src="data/2d/gradientbar.png" alt="gradient">
</div>
<div id="startmenu" class="ui-widget">
<div id="margin-area">
<div id="header">
<div id="helsinki-logo">
<img src="css/images/logo_virtual_helsinki.png" alt="Virtual Helsinki Logo">
</div>
</div>
<div id="navigation">
</div>
<div id="content">
<div id="content-left">
<h2>VIRTUAL HELSINKI</h2>
<p>Welcome to Virtual Helsinki, virtual smart capital of Finland. Virtual Helsinki utilizes and presents open data that is available in Helsinki area, such as public traffic, restaurant information and real estate market.</p>
<p>You can move your avatar in Virtual Helsinki with computer arrow keys and by pressing down left and right sides of your mouse while you move it. Check it out!</p>
</div>
<div id="content-right">
<div id="name-area">
<p>enter username for chat:</p>
<input id='username-input' type="text" name="username">
</div>
<br>
<p style="font-size:xx-small;">Virtual Helsinki has been implemented with FIWARE open software generic enablers. The 3D platform is based on realXtend 3D virtual framework and Web Tundra. Avatar and chat applications use FIWARE GEs such as 2D UI, 3D UI, Virtual Characters and Synchronization. Open data can be present as Points of Interest using POI enablers and it can run through FIWARE Context Broker and Orion technologies.</p>
</div>
</div>
<div id="footer">
<img src="css/images/logo_fiware.png" alt="FIWARE Logo">
<img src="css/images/logo_adminotech.png" alt="Adminotech Logo">
<img src="css/images/logo_cie.png" alt="CIE Logo">
<img src="css/images/logo_ludocraft.png" alt="Ludocraft Logo">
<img src="css/images/logo_playsign.png" alt="Playsign Logo">
</div>
</div>
</div>
<div id="tutorialmenu" class="ui-widget">
<div id="margin-area">
<div id="header">
</div>
<div id="navigation">
</div>
<div id="content">
<div id="tutorial-image">
<img src="css/images/ui_help_main.png" alt="Virtual Helsinki Logo">
</div>
</div>
<div id="footer">
</div>
</div>
</div>
<script id="vs-generic-effect" type="x-shader/x-vertex">
varying vec2 vUv;
varying vec4 vColor;
varying vec3 vNormal;
varying vec4 worldpos;
varying float vMask;
varying vec3 vGradientCol;
uniform vec4 gradientColor1;
uniform vec4 gradientColor2;
uniform vec4 gradientColor3;
uniform vec3 mouseposition;
uniform float animScaleUp;
uniform float animScaleBlast;
//Effect radius (1.0 / x meters)
uniform float radiusMultiplier;
void main() {
vUv = uv;
vec3 lpos = position;
worldpos = modelMatrix * vec4( position, 1.0 );
vNormal = normal;
//element pivot point stored in UV-coordinates (u = x,v = z)
vec4 pivot = modelMatrix * vec4( vUv.x,0.0,vUv.y, 1.0 );
float dstpivot = distance(pivot.xyz, mouseposition.xyz)*radiusMultiplier;
float blast = distance(worldpos.xyz, mouseposition.xyz)*animScaleBlast;
float thickness = 0.035;
float offset = 0.030;
float blastmaskout = smoothstep(0.15, 0.79, blast-offset);
float blastmaskin = smoothstep(0.79+thickness, 0.8+thickness, blast-offset);
float fmask = blastmaskout-blastmaskin;
float mask = smoothstep(animScaleUp*0.6, animScaleUp*0.95, dstpivot);
vMask = 1.0 - mask;
lpos.y = position.y + position.y *clamp(vMask + fmask,0.0,1.0)*4.0;
float buildingmask = clamp((1.0-dstpivot-0.25)*6.0, 0.0, 1.0);
vColor = vec4(color.r, fmask, buildingmask, 1.0);
//Use vertex color's red channel as a gradient step value
vGradientCol = mix(gradientColor1.rgb, gradientColor2.rgb, smoothstep(gradientColor1.a, gradientColor2.a, color.r));
vGradientCol = mix(vGradientCol, gradientColor3.rgb, smoothstep(gradientColor2.a, gradientColor3.a, color.r));
gl_Position = projectionMatrix * modelViewMatrix * vec4( lpos, 1.0 );
}
</script>
<script id="fs-effect" type="x-shader/x-fragment">
varying vec4 vColor;
varying vec3 vNormal;
varying vec3 vGradientCol;
varying vec4 worldpos;
varying float vMask; //building pivot mask
varying vec2 vUv;
uniform vec3 mouseposition;
uniform vec3 ambientColor;
uniform vec3 litColor;
uniform vec3 shadowColor;
uniform float radiusMultiplier;
void main() {
float dstpivot = distance(worldpos.xyz, mouseposition.xyz)*radiusMultiplier;
//Replace this with proper THREE.js lighting shader code
vec3 lightdir = normalize(vec3(1,0.5, 0.25));
float LdotN = clamp(dot(lightdir, vNormal), 0.0,1.0);
float lightpower = 1.7;
float ringthickness = 0.005;
float offset = 0.1;
float mask = smoothstep(0.79, 0.8, dstpivot-offset);
float mask2 = smoothstep(0.79+ringthickness, 0.8+ringthickness, dstpivot-offset);
float ringmask = mask-mask2;
vec3 ringcol = vec3(11.0,11.0,11.0) * ringmask;
vec3 finalcol = mix(vec3(1.0,1.0,1.0), vec3(0.05,0.05,0.05), mask);
//Simple "ao" effect based on y pos. Lower parts get darker value
vec3 ambientFactor = mix(ambientColor*0.55, ambientColor, clamp((worldpos.y*0.02), 0.0,1.0));
float lightmask = LdotN*lightpower - (1.0 - clamp((worldpos.y*0.05), 0.0,1.0)*2.0);
vec3 baseColor = mix(shadowColor, litColor, lightmask );
finalcol = mix(baseColor,ambientColor+LdotN*0.25, mask2) + ringcol;
gl_FragColor = vec4(finalcol * vGradientCol,1.0);
}
</script>
<script src="js/client/PoiUtility.js"></script>
<script src="js/client/UI/StartMenu.js"></script>
<script src="js/client/UI/InfoDialog.js"></script>
<script src="js/client/UI/TutorialMenu.js"></script>
<script src="js/client/UI/IssueDialog.js"></script>
<script src="js/client/UI/HeatMapBar.js"></script>
<script src="js/client/HelsinkiIssues.js"></script>
<script src="js/client/BuildingAnimation.js"></script>
<script src="js/client/LabelCull.js"></script>
<script src="js/client/BlueprintInputData.js"></script>
<script src="js/client/BlueprintOutputSensor.js"></script>
<script src="js/client/BlueprintOutputHeatmap.js"></script>
<script src="js/client/BlueprintOutputTrees.js"></script>
<script src="js/client/BlueprintOutputFlatBuildingTiles.js"></script>
<script src="js/client/BlueprintInputFlatGeoJSON.js"></script>
<script src="js/client/BlueprintOutputGeoJSONLines.js"></script>
<script src="js/client/BlueprintOutputOverpass.js"></script>
<script src="js/client/LollipopMenu.js"></script>
<script src="js/client/BlueprintOutputStreets.js"></script>
<script src="js/client/BlueprintOutputBuildingPrices.js"></script>
<script src="js/client/heatmap.min.js"></script>
<script src="js/client/debugObject.js"></script>
<script src="js/client/santanderConfig.js"></script>
<script src="js/client/heatmapConfig.js"></script>
<script src="js/client/helsinkiConfig.js"></script>
<script src="js/client/streetLabelsConfig.js"></script>
<script src="js/client/treesConfig.js"></script>
<script src="js/client/buildingPricesConfig.js"></script>
<script src="data/fonts/optimer.typeface.js"></script>
<script src="js/client/overpassConfig.js"></script>
<script src="js/client/pinView.js"></script>
<script src="js/client/ApartmentPriceMap.js"></script>
<script src="js/client/raycast.js"></script>
<script src="main.js"></script>
<script>
// Debug output
// VIZI.DEBUG = true;
</script>
</body>
</html>