-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.html
More file actions
226 lines (209 loc) · 17.8 KB
/
Copy pathdev.html
File metadata and controls
226 lines (209 loc) · 17.8 KB
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
<!DOCTYPE html>
<html lang="en" class="debug-mode">
<head>
<title>Adrift — dev</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="description" content="A Newfoundland saltbox house adrift on the open Atlantic — a real-time Three.js scene animated by live weather from MSC GeoMet.">
<meta property="og:title" content="Adrift">
<meta property="og:description" content="A Newfoundland saltbox house adrift on the open Atlantic, animated by real-time weather.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.pinchards.is/adrift/">
<link rel="icon" href="css/berry.svg" type="image/svg+xml">
<link href="css/ion.css" rel="stylesheet"/>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<script src="jsm/three.min.js"></script>
<script src="jsm/h106.js"></script>
<input type="checkbox" name="toggle" id="toggle" accesskey="h"/>
<label for="toggle" ></label>
<div class="menu">
<div id="camera-switcher">
<p>Brightness</p>
<input class="dev-btn" type="button" value="Lum0" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0, g: 0, b: 0 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum1" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.1, g: 0.1, b: 0.11 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum2" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.2, g: 0.2, b: 0.22 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum3" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.3, g: 0.3, b: 0.33 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum4" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.4, g: 0.4, b: 0.44 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum5" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.5, g: 0.5, b: 0.55 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum6" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.6, g: 0.6, b: 0.66 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum66" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.66, g: 0.66, b: 0.72 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum7" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.7, g: 0.7, b: 0.77 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum8" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.8, g: 0.8, b: 0.88 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum9" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 0.9, g: 0.9, b: 0.99 }, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="Lum10" onclick="ion.animateParamToSMP('color', ion.sc.materials.m_water.color, { r: 1, g: 1, b: 1 }, 800, easeInOutSine);"/>
<p>Transparency</p>
<input class="dev-btn" type="button" value="0.1" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.1}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.2" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.2}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.3" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.3}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.4" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.4}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.5" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.5}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.6" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.6}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.7" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.7}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.8" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.8}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.9" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 0.9}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="1.0" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.alpha, {value: 1.0}, 800, easeInOutSine);"/>
<p>Size</p>
<input class="dev-btn" type="button" value="0.1" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 1}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.2" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 2}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.3" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 3}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.4" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 4}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.5" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 5}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.6" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 6}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.7" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 7}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.8" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 8}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="0.9" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 9}, 800, easeInOutSine);"/>
<input class="dev-btn" type="button" value="1.0" onclick="ion.animateParamToSMP('alpha', ion.sc.objects.main_group.getObjectByName('water').material.uniforms.size, {value: 10}, 800, easeInOutSine);"/>
<br/>
<p>Rotate Scene</p>
<input class="dev-btn" type="button" value="0" onclick="ion.animateParamToSMP('rotate', ion.main_group.rotation, { x: 0, y: 0, z: 0 }, 900, easeInOutCubic);"/>
<input class="dev-btn" type="button" value="90" onclick="ion.animateParamToSMP('rotate', ion.main_group.rotation, { x: 0, y: Math.PI/2, z: 0 }, 900, easeInOutCubic);"/>
<input class="dev-btn" type="button" value="180" onclick="ion.animateParamToSMP('rotate', ion.main_group.rotation, { x: 0, y: Math.PI, z: 0 }, 900, easeInOutCubic);"/>
<input class="dev-btn" type="button" value="270" onclick="ion.animateParamToSMP('rotate', ion.main_group.rotation, { x: 0, y: Math.PI*1.5, z: 0 }, 900, easeInOutCubic);"/>
<input class="dev-btn" type="button" value="-90" onclick="ion.animateParamToSMP('rotate', ion.main_group.rotation, { x: 0, y: (ion.main_group.rotation.y - Math.PI/2), z: 0 }, 1200, easeInOutSine);"/>
<input class="dev-btn" type="button" value="+90" onclick="ion.animateParamToSMP('rotate', ion.main_group.rotation, { x: 0, y: (ion.main_group.rotation.y + Math.PI/2), z: 0 }, 1200, easeInOutSine);"/>
<p>Camera Controls</p>
<input class="dev-btn" type="button" value="enable Rotate" onclick="ion.orbit_controls.enableRotate = true;"/>
<input class="dev-btn" type="button" value="enable Zoom" onclick="ion.orbit_controls.enableZoom = true;"/>
<input class="dev-btn" type="button" value="enable Pan" onclick="ion.orbit_controls.enablePan = true;"/>
<input class="dev-btn" type="button" value="disable Rotate" onclick="ion.orbit_controls.enableRotate = false;"/>
<input class="dev-btn" type="button" value="disable Zoom" onclick="ion.orbit_controls.enableZoom = false;"/>
<input class="dev-btn" type="button" value="disable Pan" onclick="ion.orbit_controls.enablePan = false;"/>
<p>Camera FOV</p>
<input class="dev-btn" type="button" value="15" onclick="ion.setFov(15);"/>
<input class="dev-btn" type="button" value="25" onclick="ion.setFov(25);"/>
<input class="dev-btn" type="button" value="35" onclick="ion.setFov(35);"/>
<input class="dev-btn" type="button" value="45" onclick="ion.setFov(45);"/>
<input class="dev-btn" type="button" value="55" onclick="ion.setFov(55);"/>
<input class="dev-btn" type="button" value="65" onclick="ion.setFov(65);"/>
<!-- <p>Display Camera Info</p> -->
<!-- <input class="dev-btn" type="button" value="Show Info" onclick="ion.options.camera_info=true;ion.requestRender();"/> -->
<p>Always Render</p>
<input class="dev-btn" type="button" value="Enable" onclick="ion.options.always_render=true"/>
<input class="dev-btn" type="button" value="Disable" onclick="ion.options.always_render=false"/>
<p>House Animation</p>
<input class="dev-btn" type="button" value="Enable" onclick="ion.data.param.animation=true;ion.animateHouse();"/>
<input class="dev-btn" type="button" value="Disable" onclick="ion.data.param.animation=false"/>
<p>Music</p>
<input class="dev-btn" name="play" type="button" value="Play" onclick="ion.camera.getObjectByName('audioMain').gain.context.resume();"/>
<input class="dev-btn" type="button" value="Pause" onclick="ion.camera.getObjectByName('audioMain').gain.context.suspend();"/>
<p>Time of the Day</p>
<input class="dev-btn" type="button" value="Sunrise" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 7:40';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Early Morning" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 8:40';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Morning" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 10:00';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Noon" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 12:00';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Afternoon" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 13:40';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Late Afternoon" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 14:30';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Sunset" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 16:20';ion.updateSun();"/>
<input class="dev-btn" type="button" value="Night" onclick="ion.data.param.live_data.current.last_updated='1999-01-01 21:40';ion.updateSun();"/>
<p>House Rocking</p>
<input class="dev-btn" type="button" value="1" onclick="ion.data.param.live_data.current.wind_factor=0.1;"/>
<input class="dev-btn" type="button" value="2" onclick="ion.data.param.live_data.current.wind_factor=0.4;"/>
<input class="dev-btn" type="button" value="3" onclick="ion.data.param.live_data.current.wind_factor=0.9;"/>
<input class="dev-btn" type="button" value="4" onclick="ion.data.param.live_data.current.wind_factor=1.4;"/>
<input class="dev-btn" type="button" value="5" onclick="ion.data.param.live_data.current.wind_factor=1.9;"/>
<input class="dev-btn" type="button" value="6" onclick="ion.data.param.live_data.current.wind_factor=2.4;"/>
<input class="dev-btn" type="button" value="7" onclick="ion.data.param.live_data.current.wind_factor=2.9;"/>
<input class="dev-btn" type="button" value="8" onclick="ion.data.param.live_data.current.wind_factor=3.4;"/>
<p>House Swaying</p>
<input class="dev-btn" type="button" value="1" onclick="ion.data.param.live_data.current.sway_factor=0.5;"/>
<input class="dev-btn" type="button" value="2" onclick="ion.data.param.live_data.current.sway_factor=1.0;"/>
<input class="dev-btn" type="button" value="3" onclick="ion.data.param.live_data.current.sway_factor=1.5;"/>
<input class="dev-btn" type="button" value="4" onclick="ion.data.param.live_data.current.sway_factor=2.0;"/>
<input class="dev-btn" type="button" value="5" onclick="ion.data.param.live_data.current.sway_factor=2.5;"/>
<input class="dev-btn" type="button" value="6" onclick="ion.data.param.live_data.current.sway_factor=3.0;"/>
<input class="dev-btn" type="button" value="7" onclick="ion.data.param.live_data.current.sway_factor=3.5;"/>
<input class="dev-btn" type="button" value="8" onclick="ion.data.param.live_data.current.sway_factor=4.0;"/>
<p>House Swiveling</p>
<input class="dev-btn" type="button" value="0.1" onclick="ion.data.param.live_data.current.swiv_factor=0.1;"/>
<input class="dev-btn" type="button" value="0.5" onclick="ion.data.param.live_data.current.swiv_factor=0.5;"/>
<input class="dev-btn" type="button" value="1.0" onclick="ion.data.param.live_data.current.swiv_factor=1.0;"/>
<input class="dev-btn" type="button" value="1.5" onclick="ion.data.param.live_data.current.swiv_factor=1.5;"/>
<input class="dev-btn" type="button" value="2.0" onclick="ion.data.param.live_data.current.swiv_factor=2.0;"/>
<input class="dev-btn" type="button" value="2.5" onclick="ion.data.param.live_data.current.swiv_factor=2.5;"/>
<input class="dev-btn" type="button" value="3.0" onclick="ion.data.param.live_data.current.swiv_factor=3.0;"/>
<input class="dev-btn" type="button" value="3.5" onclick="ion.data.param.live_data.current.swiv_factor=3.5;"/>
<p>Wind Speed km/h</p>
<input class="dev-btn" type="button" value="10" onclick="ion.data.param.live_data.current.wind_kph=10;"/>
<input class="dev-btn" type="button" value="20" onclick="ion.data.param.live_data.current.wind_kph=20;"/>
<input class="dev-btn" type="button" value="30" onclick="ion.data.param.live_data.current.wind_kph=30;"/>
<input class="dev-btn" type="button" value="40" onclick="ion.data.param.live_data.current.wind_kph=40;"/>
<input class="dev-btn" type="button" value="50" onclick="ion.data.param.live_data.current.wind_kph=50;"/>
<input class="dev-btn" type="button" value="60" onclick="ion.data.param.live_data.current.wind_kph=60;"/>
<input class="dev-btn" type="button" value="70" onclick="ion.data.param.live_data.current.wind_kph=70;"/>
<input class="dev-btn" type="button" value="80" onclick="ion.data.param.live_data.current.wind_kph=80;"/>
<p>Wind Direction</p>
<input class="dev-btn" type="button" value="N" onclick="ion.data.param.live_data.current.wind_degree=5;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="NE" onclick="ion.data.param.live_data.current.wind_degree=55;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="E" onclick="ion.data.param.live_data.current.wind_degree=90;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="SE" onclick="ion.data.param.live_data.current.wind_degree=130;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="S" onclick="ion.data.param.live_data.current.wind_degree=190;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="SW" onclick="ion.data.param.live_data.current.wind_degree=225;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="W" onclick="ion.data.param.live_data.current.wind_degree=280;ion.updateWeather();"/>
<input class="dev-btn" type="button" value="NW" onclick="ion.data.param.live_data.current.wind_degree=330;ion.updateWeather();"/>
<p>Update life data</p>
<input class="dev-btn" type="button" value="Update" onclick="ion.fetchWeather();"/>
<p> Cameras </p>
</div>
</div>
<div id="my_webgl"></div>
<div id="progress">
<span id="message"></span>
<center>
<div id="progressbar" class="shadow"><div id="bar" class="shadow"></div></div>
</center>
</div>
<script>
var progressOptions = {
wrapper: $g('progress'),
bar: $g('bar'),
background: 'css/berry.svg'
};
var preloader = new THREE.Preloader( $g('my_webgl'), progressOptions );
preloader.start();
requestAnimationFrame( function (){
window.ion = new IonVR({
scene: '_yh1/_yh1.js',
secondary_scene: null,
container: $g('my_webgl'),
camera_animations: '_yh1/animations.json',
g_in: false,
g_out: false,
g_f: 2.2,
phys_shading: true,
lightprobe : true,
lightprobe_tx : 'env_cube1',
lightprobe_comp : false,
lightprobe_set : 'env_cube1',
lightprobeInt : 2,
exposure : 1.0,
spin: false,
spin_duration : 2400,
rotate_left: 0,
debug: false,
camera_info: false,
weather_info: true,
stats: false,
always_render: true,
lock_mobile_landscape: true,
enableZoom: false,
sky: true,
skybox: false,
audio : true,
audio_track: 'mp3/wind.mp3',
zoom_factor : 20,
skybox_tx: 'env_cube1',
scene_assets_url: '',
woo_tex_url : 'tex/',
woo_3d_url : '_3d/',
preloader: preloader
});
ion.onReady = function() {
ion.addCamerasButtons($g('camera-switcher'));
}
}, 1000);
</script>
</body>
</html>