Skip to content

Commit

Permalink
demo: Update three.js dependencies to r154
Browse files Browse the repository at this point in the history
Since examples switched to import maps this requires an import map shim
so that we still support older Safari versions. Eventually the shim can
go away.
  • Loading branch information
zeux committed Jul 13, 2023
1 parent 61d2f12 commit e9acfb8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
14 changes: 12 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
}
#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
</style>

<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three-examples/": "https://unpkg.com/[email protected]/examples/jsm/"
}
}
</script>
</head>

<body>
Expand All @@ -31,8 +41,8 @@
</div>

<script type="module">
import * as THREE from 'https://unpkg.com/three@0.122.0/build/three.module.js';
import { GLTFLoader } from 'https://unpkg.com/three@0.122.0/examples/jsm/loaders/GLTFLoader.js';
import * as THREE from 'three';
import { GLTFLoader } from 'three-examples/loaders/GLTFLoader.js';
import { MeshoptDecoder } from '../js/meshopt_decoder.module.js';

var container;
Expand Down
16 changes: 13 additions & 3 deletions demo/simplify.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
}
#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
</style>

<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three-examples/": "https://unpkg.com/[email protected]/examples/jsm/"
}
}
</script>
</head>

<body>
Expand All @@ -31,9 +41,9 @@
</div>

<script type="module">
import * as THREE from 'https://unpkg.com/three@0.122.0/build/three.module.js';
import { GLTFLoader } from 'https://unpkg.com/three@0.122.0/examples/jsm/loaders/GLTFLoader.js';
import { OrbitControls } from 'https://unpkg.com/three@0.122.0/examples/jsm/controls/OrbitControls.js';
import * as THREE from 'three';
import { GLTFLoader } from 'three-examples/loaders/GLTFLoader.js';
import { OrbitControls } from 'three-examples/controls/OrbitControls.js';
import { MeshoptDecoder } from '../js/meshopt_decoder.module.js';
import { MeshoptSimplifier } from '../js/meshopt_simplifier.module.js';
import { GUI } from 'https://unpkg.com/[email protected]/dist/lil-gui.esm.js';
Expand Down

0 comments on commit e9acfb8

Please sign in to comment.