|
@@ -96,7 +96,7 @@ So now we just need to start changing the `main` we pasted into
|
|
The first thing we need to do is include THREE.js into our worker.
|
|
The first thing we need to do is include THREE.js into our worker.
|
|
|
|
|
|
```js
|
|
```js
|
|
-importScripts('resources/threejs/r108/build/three.min.js');
|
|
|
|
|
|
+importScripts('resources/threejs/r110/build/three.min.js');
|
|
```
|
|
```
|
|
|
|
|
|
Then instead of looking up the canvas from the DOM we'll receive it from the
|
|
Then instead of looking up the canvas from the DOM we'll receive it from the
|
|
@@ -294,7 +294,7 @@ HTML file.
|
|
|
|
|
|
/* global importScripts, init, state */
|
|
/* global importScripts, init, state */
|
|
|
|
|
|
-importScripts('resources/threejs/r108/build/three.min.js');
|
|
|
|
|
|
+importScripts('resources/threejs/r110/build/three.min.js');
|
|
+importScripts('shared-cubes.js');
|
|
+importScripts('shared-cubes.js');
|
|
|
|
|
|
function size(data) {
|
|
function size(data) {
|
|
@@ -322,7 +322,7 @@ note we include `shared-cubes.js` which is all our three.js code
|
|
Similarly we need to include three.js and `shared-cubes.js` in the main page
|
|
Similarly we need to include three.js and `shared-cubes.js` in the main page
|
|
|
|
|
|
```html
|
|
```html
|
|
-<script src="resources/threejs/r108/build/three.min.js"></script>
|
|
|
|
|
|
+<script src="resources/threejs/r110/build/three.min.js"></script>
|
|
<script src="shared-cubes.js"><script>
|
|
<script src="shared-cubes.js"><script>
|
|
```
|
|
```
|
|
We can remove the HTML and CSS we added previously
|
|
We can remove the HTML and CSS we added previously
|
|
@@ -614,7 +614,7 @@ of the DOM events they use. Maybe we could pass in our own
|
|
object that has the same API surface as a DOM element.
|
|
object that has the same API surface as a DOM element.
|
|
We only need to support the features the OrbitControls need.
|
|
We only need to support the features the OrbitControls need.
|
|
|
|
|
|
-Digging through the [OrbitControls source code](https://github.com/gfxfundamentals/threejsfundamentals/blob/master/threejs/resources/threejs/r108/js/controls/OrbitControls.js)
|
|
|
|
|
|
+Digging through the [OrbitControls source code](https://github.com/gfxfundamentals/threejsfundamentals/blob/master/threejs/resources/threejs/r110/js/controls/OrbitControls.js)
|
|
it looks like we need to handle the following events.
|
|
it looks like we need to handle the following events.
|
|
|
|
|
|
* contextmenu
|
|
* contextmenu
|
|
@@ -732,8 +732,8 @@ We also need to actually add the `OrbitControls` to the top of
|
|
the script
|
|
the script
|
|
|
|
|
|
```js
|
|
```js
|
|
-importScripts('resources/threejs/r108/build/three.min/js');
|
|
|
|
-+importScripts('resources/threejs/r108/examples/js/controls/OrbitControls.js');
|
|
|
|
|
|
+importScripts('resources/threejs/r110/build/three.min/js');
|
|
|
|
++importScripts('resources/threejs/r110/examples/js/controls/OrbitControls.js');
|
|
*importScripts('shared-orbitcontrols.js');
|
|
*importScripts('shared-orbitcontrols.js');
|
|
```
|
|
```
|
|
|
|
|