-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathindex.html
516 lines (427 loc) · 28.7 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
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
<!DOCTYPE html>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-113300143-1"></script>
<script>
if (document.location.hostname != 'localhost') {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-113300143-1');
}
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=1280, user-scalable=no">
<title>Intro to WebGL with Three.js</title>
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Source+Code+Pro:400,700" rel="stylesheet" type="text/css">
<!-- Required stylesheet -->
<link rel="stylesheet" href="deck.js/core/deck.core.css">
<!-- Extension CSS files go here. Remove or add as needed. -->
<link rel="stylesheet" media="screen" href="deck.js/extensions/menu/deck.menu.css">
<link rel="stylesheet" media="screen" href="deck.js/extensions/goto/deck.goto.css">
<link rel="stylesheet" media="screen" href="deck.js/extensions/status/deck.status.css">
<link rel="stylesheet" media="screen" href="deck.js/extensions/navigation/deck.navigation.css">
<!-- Style theme. More available in /themes/style/ or create your own. -->
<link rel="stylesheet" media="screen" href="resources/theme.css">
<!-- Transition theme. More available in /themes/transition/ or create your own. -->
<!-- <link rel="stylesheet" media="screen" href="deck.js/themes/transition/fade.css"> -->
<!-- Basic black and white print styles -->
<!-- <link rel="stylesheet" media="print" href="deck.js/core/print.css"> -->
<!-- Required Modernizr file -->
<script src="deck.js/modernizr.custom.js"></script>
</head>
<body class="language-javascript">
<div class="deck-container">
<!-- Begin slides. Just make elements with a class of slide. -->
<section class="slide">
<iframe src="iframes/cube-title.html" frameborder="0"></iframe>
<div class="page-cover">
<h1 class="cover-title">Intro to WebGL<small>with Three.js</small></h1>
</div>
</section>
<section class="slide">
<h2>WebGL</h2>
<p>JavaScript API for rendering interactive 2D and 3D graphics<br>
inside an HTML <code class="language-markup"><canvas></code> element.</p>
<div class="slide">
<h3>Browser Support</h3>
<img src="images/webgl-browser-support.png" alt="">
</div>
</section>
<section class="slide">
<video class="spotlight" src="videos/webgl-demos.mp4"></video>
</section>
<section class="slide">
<iframe src="http://threejs.org/examples/webgl_points_sprites" frameborder="0"></iframe>
</section>
<section class="slide">
<h2>three.js</h2>
<p><a href="https://threejs.org/" target="_blank">threejs.org</a></p>
<p class="slide">3D Javascript Library</p>
<p class="slide">Renderers: WebGL, <canvas>, <svg>, CSS3D / DOM, and more</p>
<p class="slide">Scenes, Cameras, Geometry, 3D Model Loaders, Lights, Materials,<br>Shaders, Particles, Animation, Math Utilities</p>
</section>
<section class="slide">
<!-- <img class="spotlight" src="images/threejs.png" alt=""> -->
<iframe src="https://threejs.org" frameborder="0"></iframe>
<!-- <div class="abs-bc bc-text outline"><a href="https://threejs.org/" style="font-weight: bold; text-decoration: none;" target="_blank">threejs.org</a></div> -->
</section>
<section class="slide">
<img src="images/300.jpg" alt="" class="spotlight">
</section>
<section class="slide">
<iframe src="iframes/getting-started.html" frameborder="0"></iframe>
</section>
<section class="slide">
<pre class="overlay-full language-markup" style="font-size: 32px;"><code style="font-size: 32px;"><!DOCTYPE html>
<html>
<head>
<title>Basic Three.js App</title>
<style>
html, body { margin: 0; padding: 0; overflow: hidden; }
</style>
</head>
<body>
<script src="js/three.min.js"></script>
<script>
// Javascript will go here.
</script>
</body>
</html></code></pre>
</section>
<section class="slide" id="scene-required">
<pre class="overlay-full language-none" style="font-size: 24px;">
<code><span class="scene-required"><span class="token keyword">var</span> scene <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>Scene</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="token keyword">var</span> aspect <span class="token operator">=</span> window<span class="token punctuation">.</span>innerWidth <span class="token operator">/</span> window<span class="token punctuation">.</span>innerHeight<span class="token punctuation">;</span>
<span class="scene-required"><span class="token keyword">var</span> camera <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>PerspectiveCamera</span><span class="token punctuation">(</span> <span class="token number">75</span><span class="token punctuation">,</span> aspect<span class="token punctuation">,</span> <span class="token number">0.1</span><span class="token punctuation">,</span> <span class="token number">1000</span> <span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> renderer <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>WebGLRenderer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span>
renderer<span class="token punctuation">.</span><span class="token function">setSize<span class="token punctuation">(</span> </span>window<span class="token punctuation">.</span>innerWidth<span class="token punctuation">,</span> window<span class="token punctuation">.</span>innerHeight <span class="token punctuation">)</span><span class="token punctuation">;</span>
document<span class="token punctuation">.</span>body<span class="token punctuation">.</span><span class="token function">appendChild<span class="token punctuation">(</span> </span>renderer<span class="token punctuation">.</span>domElement <span class="token punctuation">)</span><span class="token punctuation">;</span>
<div class="slide" id="scene-object"><span class="scene-object"><span class="token keyword">var</span> geometry <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>BoxGeometry</span><span class="token punctuation">(</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span> <span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> material <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>MeshNormalMaterial</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">var</span> cube <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>Mesh</span><span class="token punctuation">(</span> geometry<span class="token punctuation">,</span> material <span class="token punctuation">)</span><span class="token punctuation">;</span>
scene<span class="token punctuation">.</span><span class="token function">add<span class="token punctuation">(</span></span> cube <span class="token punctuation">)</span><span class="token punctuation">;</span></span>
camera<span class="token punctuation">.</span>position<span class="token punctuation">.</span>z <span class="token operator">=</span> <span class="token number">5</span><span class="token punctuation">;</span></div>
<div class="slide" id="render-loop"><span class="render-loop"><span class="token keyword">var</span> render <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token function">requestAnimationFrame<span class="token punctuation">(</span></span> render <span class="token punctuation">)</span><span class="token punctuation">;</span>
cube<span class="token punctuation">.</span>rotation<span class="token punctuation">.</span>x <span class="token operator">+</span><span class="token operator">=</span> <span class="token number">0.1</span><span class="token punctuation">;</span>
cube<span class="token punctuation">.</span>rotation<span class="token punctuation">.</span>y <span class="token operator">+</span><span class="token operator">=</span> <span class="token number">0.1</span><span class="token punctuation">;</span>
renderer<span class="token punctuation">.</span><span class="token function">render<span class="token punctuation">(</span></span> scene<span class="token punctuation">,</span> camera <span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span></span>
<span class="token function">render<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span></div></code></pre>
</section>
<section class="slide">
<h2>Scene Graph</h2>
<img src="images/node-map.png" alt="">
</section>
<section class="slide">
<h2>Object3D</h2>
<pre><code>var group = new THREE.Group();
scene.add( group );
group.add( mesh1 );
group.add( mesh2 );
mesh2.visible = false;
group.remove( mesh2 );
group.children // mesh1
group.parent // scene</code></pre>
<!-- mesh.clone();
mesh.lookAt( scene.position );
THREE.SceneUtils.detach( child, parent, scene );
THREE.SceneUtils.attach( child, scene, parent ); -->
</section>
<section class="slide">
<iframe src="iframes/hierarchy.html" frameborder="0"></iframe>
</section>
<section class="slide instant">
<iframe src="iframes/transforms.html" frameborder="0"></iframe>
<h2>Object3D Transforms</h2>
<div class="temp abs-bc"><pre><code>mesh.position.x = 0</code></pre></div>
<div class="slide temp abs-bc"><pre><code>mesh.position.x = -100</code></pre></div>
<div class="slide temp abs-bc"><pre><code>mesh.scale.set(2,2,2)</code></pre></div>
<div class="slide temp abs-bc"><pre><code>mesh.rotation.y = Math.PI / 4</code></pre></div>
<div class="slide temp abs-bc"><pre><code>mesh.rotation.y = Math.PI * 5 / 4</code></pre></div>
</section>
<section class="slide">
<h2>Unit Circle</h2>
<p class="temp"><img src="images/unit-circle.png" alt=""></p>
<p class="slide"><img src="images/unit-circle-radians.png" alt=""></p>
<div class="slide temp abs-bc"><pre><code>mesh.rotation.y = THREE.Math.degToRad(45);</code></pre></div>
<!-- http://etc.usf.edu/clipart/ -->
<!-- http://etc.usf.edu/clipart/galleries/617-unit-circles -->
</section>
<section class="slide">
<iframe src="iframes/circle-animation.html" frameborder="0" style="z-index: 3;"></iframe>
<h2>Unit Circle</h2>
<p><img src="images/unit-circle-trig.png" alt=""></p>
<div class="slide temp abs-bc">
<pre><code>mesh.position.x = Math.cos( time );
mesh.position.y = Math.sin( time );</code></pre></div>
<div class="slide"></div>
</section>
<section class="slide instant">
<iframe src="iframes/camera.html" frameborder="0" id="camera-demo"></iframe>
<h2 style="position: relative;">Cameras</h2>
<div class="temp abs-bc"><pre><code>cam = new THREE.PerspectiveCamera( fov, aspect, near, far )</code></pre></div>
<div class="slide temp abs-bc"><pre><code>cam = new THREE.PerspectiveCamera( fov, aspect, near, far )</code></pre></div>
<div class="slide temp abs-bc"><pre><code>cam = new THREE.PerspectiveCamera( fov, aspect, near, far )</code></pre></div>
<div class="slide temp abs-bc"><pre><code>camera.fov = 15</code></pre></div>
<div class="slide temp abs-bc"><pre><code>camera.fov = 60</code></pre></div>
<div class="slide temp abs-bc"><pre><code>camera.far = 1000</code></pre></div>
<div class="slide temp abs-bc"><pre><code>camera.far = 3000</code></pre></div>
<div class="slide temp abs-bc"><pre style="font-size: 26px;"><code style="font-size: 26px;">camera = new THREE.OrthographicCamera( left, right, top, bottom, near, far );</code></pre></div>
</section>
<section class="slide">
<!-- <iframe src="http://threejs.org/examples/misc_controls_orbit" frameborder="0"></iframe> -->
<iframe src="iframes/misc_controls_orbit.html" frameborder="0"></iframe>
</section>
<section class="slide">
<h2>Camera Controls</h2>
<p><a href="https://github.com/mrdoob/three.js/blob/dev/examples/js/controls/OrbitControls.js" target="_blank">/three.js/examples/js/controls/OrbitControls.js</a></p>
<div class="slide temp"><pre><code class="language-markup"><script src="path/to/OrbitControls.js"></script></code>
<code class="language-javascript">controls = new THREE.OrbitControls( camera );
function render() {
requestAnimationFrame( render );
controls.update();
renderer.render( scene, camera );
}</code></pre></div>
<div class="slide temp"><pre><code>controls.enablePan = false;
controls.enableZoom = false;
controls.enableRotate = false;
controls.minDistance
controls.maxDistance
controls.minPolarAngle
controls.maxPolarAngle</code></pre></div>
</section>
<section class="slide">
<img class="spotlight" src="images/orbit-all-the-things.jpg" alt="">
</section>
<section class="slide">
<img class="spotlight" src="images/geometry.png" alt="">
<div class="page-cover">
<h1 class="cover-title">Geometry</small></h1>
</div>
</section>
<section class="slide">
<h2>Geometry</h2>
<iframe src="iframes/geometry.html" frameborder="0"></iframe>
<div class="slide temp abs-bc"><pre><code>var geo = new THREE.BoxGeometry( width, height, depth );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var geo = new THREE.SphereGeometry( 60, 24, 16 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var geo = new THREE.CylinderGeometry( ... );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var geo = new THREE.TorusGeometry( ... );</code></pre></div>
</section>
<section class="slide">
<img class="spotlight" src="images/marble.jpg" alt="">
<div class="page-cover">
<h1 class="cover-title cover-inverted">Materials</small></h1>
</div>
</section>
<section class="slide">
<h2>Materials</h2>
<iframe src="iframes/material.html" frameborder="0"></iframe>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshBasicMaterial({ ... });</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshLambertMaterial({ ... });</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshPhongMaterial({ ... });</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshStandardMaterial({ ... });</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshToonMaterial({ ... });</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshNormalMaterial({ ... });</code></pre></div>
<div class="slide temp abs-bc"><pre><code>var material = new THREE.MeshNormalMaterial({ ... });</code></pre></div>
</section>
<section class="slide">
<h2>Material Properties</h2>
<iframe src="iframes/material-options.html" frameborder="0"></iframe>
<div class="temp abs-bc"><pre><code>flatShading: false</code></pre></div>
<div class="slide temp abs-bc"><pre><code>flatShading: true</code></pre></div>
<div class="slide temp abs-bc"><pre><code>flatShading: true // face normals</code></pre></div>
<div class="slide temp abs-bc"><pre><code>flatShading: true // face normals</code></pre></div>
<div class="slide temp abs-bc"><pre><code>flatShading: false // vertex normals</code></pre></div>
<div class="slide temp abs-bc"><pre><code>color: 0xaaaaaa</code></pre></div>
<div class="slide temp abs-bc"><pre><code>color: 0x3794cf</code></pre></div>
<div class="slide temp abs-bc"><pre><code>shininess: 40</code></pre></div>
<div class="slide temp abs-bc"><pre><code>shininess: 80</code></pre></div>
<div class="slide temp abs-bc"><pre><code>wireframe: true</code></pre></div>
<div class="slide temp abs-bc"></div>
<div class="slide temp abs-bc"><pre><code>transparent: true, opacity: 0.5</code></pre></div>
</section>
<div class="slide">
<h2>UVs</h2>
<iframe src="iframes/UVs.html" frameborder="0"></iframe>
<div class="slide"></div>
<div class="slide"></div>
<div class="slide"></div>
</div>
<section class="slide">
<h2>Texture Mapping</h2>
<iframe src="iframes/texture-mapping.html" frameborder="0"></iframe>
<div class="temp abs-bc"><pre><code>var loader = new THREE.TextureLoader();
var texture = loader.load("color-map.jpg");</code></pre></div>
<div class="temp slide abs-bc"><pre><code>map: texture</code></pre></div>
<div class="temp slide abs-bc"><pre><code>normalMap: texture</code></pre></div>
<div class="temp slide abs-bc"><pre><code>specularMap: texture</code></pre></div>
<div class="temp slide abs-bc"><pre><code>map: colorMap, specularMap: specMap, normalMap: normalMap</code></pre></div>
<div class="temp slide abs-bc"><pre><code>var material = new THREE.MeshPhongMaterial({
color: 0xaaaaaa,
specular: 0x333333,
shininess: 15,
map: colorMap,
specularMap: specMap,
normalMap: normalMap
});</code></pre></div>
</section>
<section class="slide">
<img class="spotlight" src="images/sunny-sky.jpg" alt="">
<div class="page-cover">
<h1 class="cover-title cover-inverted">Lights</small></h1>
</div>
</section>
<section class="slide">
<h2>Lights</h2>
<iframe src="iframes/lights.html" frameborder="0"></iframe>
<div class="temp abs-bc"><pre><code>light = new THREE.DirectionalLight( 0xdddddd, 0.8 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.position.set( -80, 80, 80 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.position.x = 80;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.target.position = 160;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.position.x = -80;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.DirectionalLight( 0xdddddd, 0.8 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.DirectionalLight( 0xb4e7f2, 0.8 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.DirectionalLight( 0xb4e7f2, 0.2 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.DirectionalLight( 0xb4e7f2, 1.5 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.DirectionalLight( 0xb4e7f2, 0.8 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.PointLight( 0xb4e7f2, 0.8 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.PointLight( 0xb4e7f2, 0.8 );</code></pre></div>
<!-- <div class="slide temp abs-bc"><pre><code>light.distance = 300;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.distance = 0;</code></pre></div> -->
<div class="slide temp abs-bc"><pre><code>light = new THREE.SpotLight( 0xb4e7f2, 0.8 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.angle = Math.PI / 9;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.angle = Math.PI / 5;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.penumbra = 0.4;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.penumbra = 0;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light.penumbra = 0.8;</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.AmbientLight( 0x444444 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.AmbientLight( 0x000000 );</code></pre></div>
<div class="slide temp abs-bc"><pre><code>light = new THREE.AmbientLight( 0x444444 );</code></pre></div>
</section>
<section class="slide">
<iframe src="iframes/lights-three-point.html" frameborder="0"></iframe>
<h2 style="position: relative;">Three Point Lighting</h2>
<div class="temp abs-bc bc-text outline">Key, Fill, Rim</div>
<div class="slide temp abs-bc bc-text outline">Key, Fill, Rim</div>
</section>
<section class="slide">
<h2>Model Converter</h2>
<p>OBJ to JSON converter Node tool<br>
<a href="https://github.com/mrdoob/three.js/blob/dev/utils/converters/obj2three.js" target="_blank">/three.js/utils/converters/obj2three.js</a></p>
<p><img src="images/obj-json.png" alt=""></p>
<div class="temp abs-bc"><pre><code>node obj2three.js teapot.obj</code></pre></div>
</section>
<section class="slide">
<iframe src="iframes/loader.html" frameborder="0"></iframe>
<h2>Model Loader</h2>
<div class="slide temp abs-bc"><pre><code>var loader = new THREE.ObjectLoader();
loader.load("teapot.json", function( group ) {
mesh = group.children[0];
mesh.material = new THREE.MeshPhongMaterial();
scene.add( mesh );
});</code></pre></div>
</section>
<section class="slide">
<!-- <iframe src="http://threejs.org/examples/webgl_materials_cubemap" frameborder="0"></iframe> -->
<iframe src="iframes/cubemap.html" frameborder="0"></iframe>
<div class="slide"></div>
<div class="slide"></div>
</section>
<section class="slide">
<img class="spotlight" src="images/interaction.png" alt="">
<div class="page-cover">
<h1 class="cover-title">Interaction</small></h1>
</div>
</section>
<section class="slide">
<!-- http://stemkoski.github.io/Three.js/Mouse-Over.html -->
<!-- http://threejs.org/examples/webgl_interactive_cubes -->
<!-- http://soledadpenades.com/articles/three-js-tutorials/object-picking/ -->
<iframe src="http://threejs.org/examples/webgl_interactive_cubes" frameborder="0"></iframe>
</section>
<section class="slide instant">
<iframe src="iframes/interactive-cubes-helpers.html" frameborder="0"></iframe>
<div class="slide"></div>
<div class="slide"></div>
</section>
<section class="slide">
<pre class="overlay-full language-none" style="font-size: 26px;"><code><span class="interaction1"><span class="token comment" spellcheck="true">// normalized device coordinates
</span>mouse<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token punctuation">(</span> event<span class="token punctuation">.</span>clientX <span class="token operator">/</span> window<span class="token punctuation">.</span>innerWidth <span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token number">2</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">;</span>
mouse<span class="token punctuation">.</span>y <span class="token operator">=</span> <span class="token operator">-</span> <span class="token punctuation">(</span> event<span class="token punctuation">.</span>clientY <span class="token operator">/</span> window<span class="token punctuation">.</span>innerHeight <span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token number">2</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span></span>
raycaster <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">THREE<span class="token punctuation">.</span>Raycaster</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="interaction2">raycaster<span class="token punctuation">.</span><span class="token function">setFromCamera<span class="token punctuation">(</span></span> mouse<span class="token punctuation">,</span> camera <span class="token punctuation">)</span><span class="token punctuation">;</span></span>
<span class="interaction3"><span class="token keyword">var</span> intersects <span class="token operator">=</span> raycaster<span class="token punctuation">.</span><span class="token function">intersectObjects<span class="token punctuation">(</span></span> scene<span class="token punctuation">.</span>children <span class="token punctuation">)</span><span class="token punctuation">;</span>
INTERSECTED <span class="token operator">=</span> intersects<span class="token punctuation">[</span> <span class="token number">0</span> <span class="token punctuation">]</span><span class="token punctuation">.</span>object<span class="token punctuation">;</span></span></code></pre>
<div class="slide" id="interaction1"></div>
<div class="slide" id="interaction2"></div>
<div class="slide" id="interaction3"></div>
</section>
<section class="slide">
<iframe src="https://davidlyons.dev/pyramid" frameborder="0"></iframe>
<div class="page-cover slide temp">
<h1 class="cover-title">
<br>
<small><a href="https://davidlyons.dev" style="color: #fff; text-shadow: 0 5px 3px rgba(0,0,0,0.7);">davidlyons.dev</a></small>
</h1>
</div>
</section>
<section class="slide">
<div class="page-cover">
<h1 class="cover-title">
Thanks
<small><a href="https://davidlyons.dev">davidlyons.dev</a></small>
<!-- <br>
<small><img src="images/twitter.png" style="vertical-align: middle;" alt=""><a href="http://www.twitter.com/davidscottlyons">davidscottlyons</a></small>
<small><img src="images/octocat.png" style="vertical-align: middle;" alt=""><a href="http://www.github.com/davidlyons">davidlyons</a></small> -->
</h1>
</div>
</section>
<!-- End slides. -->
<!-- Begin extension snippets. Add or remove as needed. -->
<!-- deck.status snippet -->
<p class="deck-status" aria-role="status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- deck.goto snippet -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<!-- End extension snippets. -->
</div>
<div id="info-left">
<a href="https://davidlyons.dev">davidlyons.dev</a>
</div>
<!-- deck.navigation snippet -->
<div class="deck-nav" aria-role="navigation">
<a href="#" class="deck-prev-link" title="Previous">‹</a>
<a href="#" class="deck-next-link" title="Next">›</a>
</div>
<div id="info-right">
<a href="http://youtu.be/6eLl8yQnxHQ" target="_blank">Watch Presentation Video</a><br>
<a href="https://github.com/davidlyons/threejs-intro" target="_blank">Slides on GitHub</a>
</div>
<!-- Required JS files. -->
<script src="resources/jquery-2.1.1.min.js"></script>
<script src="deck.js/core/deck.core.js"></script>
<!-- Extension JS files. Add or remove as needed. -->
<script src="deck.js/extensions/menu/deck.menu.js"></script>
<script src="deck.js/extensions/goto/deck.goto.js"></script>
<script src="deck.js/extensions/status/deck.status.js"></script>
<script src="deck.js/extensions/navigation/deck.navigation.js"></script>
<script src="iframes/three/three.min.js"></script>
<script src="resources/VRController.js"></script>
<!-- Initialize the deck -->
<script src="resources/slides.js"></script>
<script src="resources/prism.js"></script>
</body>
</html>