-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoakland-gran-fondo-r11.html
327 lines (206 loc) · 9.61 KB
/
oakland-gran-fondo-r11.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!doctype html>
<html lang=en >
<head>
<meta charset=utf-8 >
<title>Oakland Gran Fondo 2016 3D Viewer R11</title>
<meta name=viewport content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no' >
<meta name=description content='Elevations Core3, load and display interactive 3D maps. 2D maps applied as overlays on 3D meshes.
Select source and resolution of overlays. Toggle or control display of various viewing and debugging aids. Display messages as 3D placards.
Load and display aircraft flightpath data from CSV files as lines with width.
Load and display 2D bitmaps as riders. Display riders cycling along the path.' >
<meta name=keywords content='cycling,gran fondo,gps,cartography,maps,geology,geography,vr,interactive,WebGL,Three.js,JavaScript,GitHub,FOSS,3D,STEM' >
<meta name=date content='2016-10-03' >
</head>
<body>
<!--
<script src=https://mrdoob.github.io/three.js/build/three.min.js ></script>
<script src=https://mrdoob.github.io/three.js/examples/js/controls/OrbitControls.js ></script>
<script src=https://mrdoob.github.io/three.js/examples/js/libs/stats.min.js ></script>
-->
<script src=https://rawgit.com/mrdoob/three.js/dev/build/three.min.js ></script>
<script src=https://rawgit.com/mrdoob/three.js/dev/examples/js/controls/OrbitControls.js ></script>
<script src=https://rawgit.com/mrdoob/three.js/dev/examples/js/libs/stats.min.js ></script>
<script src=https://rawgit.com/spite/THREE.MeshLine/master/src/THREE.MeshLine.js ></script>
<!--
<script src=https://jaanga.github.io/terrain3/elevations-core3/a-cor-core/core-r2.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3//b-sel-select/select-r2.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3//c-ovr-overlay/overlay-r1.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3//d-ter-terrain/terrain-r1.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3//e-thr-threejs/threejs-r1.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3/f-map-map/map-r2.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3/g-msh-mesh-lines/mesh-lines-r1.js ></script>
<script src=https://jaanga.github.io/terrain3/elevations-core3/h-kml-kml/kml-r2.js ></script>
-->
<script src=./a-cor-core/core-r2.js ></script>
<script src=./b-sel-select/select-r3.js ></script>
<script src=./c-ovr-overlay/overlay-r1.js ></script>
<script src=./d-ter-terrain/terrain-r1.js ></script>
<script src=./e-thr-threejs/threejs-r1.js ></script>
<script src=./f-map-map/map-r2.js ></script>
<script src=./pla-placards/placards-r1.js ></script>
<script src=./g-msh-mesh-lines/mesh-lines-r2.js ></script>
<script src=./h-kml-kml/kml-r3.js ></script>
<script src=./i-cas-camera-action-select/camera-action-select-r3.js ></script>
<script>
var sponsors;
// SEL.urlAPITreeContents = 'https://api.github.com/repos/cynthiaarmour/cynthiaarmour.github.io/git/trees/master?recursive=1';
SEL.urlAPITreeContents = 'https://api.github.com/repos/jaanga/terrain3/git/trees/gh-pages?recursive=1';
SEL.urlBase = '../elevations-data/';
// SEL.urlBase = 'https://cynthiaarmour.github.io/oakland-gran-fondo-2016-assets/' + SEL.searchInFolder;
// SEL.searchInFolder = 'elevations-data-oakland-gran-fondo';
SEL.searchInFolder = SEL.folders[ 3 ];
// SEL.defaultFile = 'https://cynthiaarmour.github.io/oakland-gran-fondo-2016-assets/maps/oakland-gran-fondo-28_14_2627_6329_7_3_490_210_.json';
SEL.defaultFile = SEL.urlBase + SEL.searchInFolder + '/oakland-gran-fondo-28_2627_6329_7_3_490_210_.json';
// SEL.defaultFile; // if no default, select a random file
CAS.marker = 'Rider';
CAS.actorScale = 0.005;
CAS.cameraOffsetChase = v( -0.02, 0.05, -0.02 );
CAS.cameraOffsetInside = v( -0.003, 0.02, -0.01 );
CAS.cameraOffsetTrack = v( 0, 0.03, 0.05 );
CAS.cameraOffsetWorld = v( 0, 0.05, 0.12 );
COR.taglineHeader =
'<div><small>' +
'Rotate|Zoom|Pan => 1|2|3 finger/button' + b +
'Slide menu => \'hamburger\' icon' +
'</small></div>';
// load all custom methods first
COR.getMenuDetailsHeader = function() {
var menuDetailsHeader =
// '<h3>' +
// '<a href=http://jaanga.github.io/ title="Jaanga - your 3D happy place" > ❦ </a> » ' +
// '<a href=http://jaanga.github.io/terrain3/ title="your happy mappy place" > Terrain3 </a> » ' +
// '</h3>' +
'<h2>' +
'<a href="" title="Click here to refresh this page" >' + document.title + '</a> ~ ' +
// '<a href=index.html#readme.md title="Click here for help and information" > ⓘ </a>' +
'<a href=https://cynthiaarmour.github.io/oakland-gran-fondo-2016/#readme.md onmouseover=popHelp.style.display=""; onmouseout=popHelp.style.display="none"; > ⓘ </a>' +
'</h2>' +
COR.taglineHeader +
'<div class=popUp id=popHelp style=display:none; ><p>Hi there!</p>Click the i-in-circle, info icon for latest updates.</div>' +
b;
return menuDetailsHeader;
};
COR.getMenuFooter = function() {
var footer =
'<hr>' +
'<center>' +
'<a href=https://bikeeastbay.org/ style=text-decoration:none; onmouseover=pop2.style.display=""; onmouseout=pop2.style.display="none"; >' +
'<img src="https://cynthiaarmour.github.io/oakland-gran-fondo-2016-assets/maps/logo-beb-main-site.png" width=150px ></a>' + b + b +
'<a href=http://www.oaklandgranfondo.com/ ><img src="https://cynthiaarmour.github.io/oakland-gran-fondo-2016/elevations-data/elevations-data-oakland-gran-fondo/OGF-HOR-245.png" width=150px ></a>' + b +
'</center>' +
'<div class=popUp id=pop2 style= display:none;bottom:100px; >' +
'We’ve been working for safe, convenient and enjoyable bicycling for all people in the East Bay since 1972' +
'</div>' +
b;
return footer;
};
COR.onLoadJSONFile = function() {
COR.getPlaceDefaults();
OVR.setMenuDetailsOverlay();
MAP.initMapGeometry();
KML.drawPath();
THR.line3.position.y = 0.0005;
if ( !THR.axisHelper ) {
sponsors = PLA.drawBitMap( SEL.urlBase + SEL.searchInFolder + '/GFO-Sponsor-Bar-2016.jpg' );
sponsors.scale.set( 0.14, 0.02, 1 );
sponsors.rotation.x = pi05;
THR.scene.add( sponsors );
THR.axisHelper = new THREE.AxisHelper( 50 );
THR.scene.add( THR.axisHelper );
THR.axisHelper.visible = false;
}
sponsors.position.set( COR.place.longitude, -0.0001, - COR.place.latitude );
fNames = [
'oakland-gran-fondo-100-r1_11_328_791_3_3_510_510_.json',
'oakland-gran-fondo-28_14_2627_6329_7_3_490_210_.json'
]
sponsors.visible = fNames.indexOf(COR.fileName ) > -1 ? true : false;
if ( !CAS.actor ) { CAS.getActorBitmap( SEL.urlBase + SEL.searchInFolder + '/logo-beb-main-site.png' ); }
for ( var i = 0; i < SEL.files.length; i++ ) {
if ( SEL.files[ i ] === COR.fileName ) {
SELselFiles.selectedIndex = i;
break;
}
}
};
THR.viewObject = function( mesh ) {
var cameraPosition;
mesh.updateMatrixWorld();
mesh.geometry.computeBoundingSphere();
THR.radius = mesh.geometry.boundingSphere.radius;
THR.center = mesh.position.clone().add( mesh.geometry.boundingSphere.center );
THR.controls.target.copy( THR.center );
THR.controls.maxDistance = 3 * THR.radius;
}
CAS.cameraTrack = function() {
CAS.offsetStart = 0;
CAS.offsetEnd = 1;
if ( COR.fileName === "oakland-gran-fondo-100-r1_14_2642_6341_3_3_510_510_.json" ) { index = CAS.offsetStart = 0.32; CAS.offsetEnd = 0.39; }
if ( COR.fileName === "oakland-gran-fondo-28_14_2631_6329_3_3_510_510_.json" ) { index = CAS.offsetStart = 0.25; CAS.offsetEnd = 0.76; }
THR.controls.autoRotate = false;
CHKoutSpeed.value = CAS.cameraPoints = 25;
THR.scene.add( THR.camera );
//console.log( 'got track', 23 );
if ( MAP.mesh ) {
THR.viewObject( MAP.mesh );
THR.camera.position.copy( THR.center.clone() ).add( CAS.cameraOffsetTrack );
} else {
THR.camera.position.copy( origin.clone().add( CAS.cameraOffsetTrack ) );
}
THR.controls.target.copy( CAS.center.clone() );
target = CAS.actor.position;
THR.controls.target.copy( target );
follow = true;
}
CAS.cameraWorld = function() {
THR.controls.autoRotate = false;
CHKoutSpeed.value = CAS.cameraPoints = 25;
THR.scene.add( THR.camera );
target = THR.center.clone();
THR.controls.target.copy( target );
if ( MAP.mesh !== undefined ) {
THR.viewObject( MAP.mesh );
THR.camera.position.copy( THR.center.clone() ).add( CAS.cameraOffsetWorld );
} else {
THR.camera.position.copy( CAS.cameraOffsetWorld );
}
follow = false;
}
init();
CAS.animatePlusLookAt();
function init() {
COR.initLeftMenu();
COR.menu.innerHTML =
COR.getMenuDetailsHeader() +
SEL.getMenuDetailsSelectFile() +
CAS.getMenuDetailsCameraActions() +
// KML.getMenuDetailsKML() +
OVR.getMenuDetailsOverlay() +
TER.getMenuDetailsTerrain() +
// COR.getMenuDetailsObjectProperties() +
COR.getMenuDetailsAbout() +
COR.getMenuFooter() +
b;
if ( window.self !== window.top ) {
hamburger.style.left = '0px';
} else {
if ( location.hash.length ) { SEL.defaultFile = location.hash.slice( 6 ); }
}
SELpFolder.style.display = 'none';
SELdetailsSelectFile.children[0].innerHTML = '<h3>Select your route</h3>';
SELselFiles.size = 5;
// SELdetailsSelectFile.setAttribute('open', 'open');
TERchkAxisHelper.checked = false;
TERchkBoxHelper.checked = false;
// detailsOverlay.setAttribute('open', 'open');
// detailsOverlayParameters.setAttribute('open', 'open');
// detailsTerrain.setAttribute('open', 'open');
// detailsTerrainParameters.setAttribute('open', 'open');
// start somewhere in the first half of the ride
index = 0.4 * Math.random();
SEL.getGitHubAPITreeContents();
THR.getThreeJS();
}
</script>
</body>
</html>