language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-custom-geometry-cube-vertex-normals.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-custom-geometry-cube.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-custom-geometry-heightmap.html | @@ -19,12 +19,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -37,7 +34,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(20, 20, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 0, 0);
controls.update();
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-debug-js-clearing-logger.html | @@ -32,11 +32,8 @@
<pre></pre>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
class ClearingLogger {
constructor(elem) { | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-debug-js-html-elements.html | @@ -33,11 +33,8 @@
<div>z:<span id="z"></span></div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-debug-js-params.html | @@ -43,11 +43,8 @@
</div>
<div id="info">click to launch</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
/**
* Returns the query parameters as a key/value object. | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-debugging-mcve.html | @@ -1,12 +1,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -19,7 +16,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 1000, 2000);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-fog-gui.html | @@ -19,17 +19,14 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
const renderer = new THREE.WebGLRenderer({canvas});
- const gui = new dat.GUI();
+ const gui = new GUI();
const fov = 75;
const aspect = 2; // the canvas default | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-fog.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-fundamentals-3-cubes.html | @@ -9,11 +9,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-fundamentals-with-animation.html | @@ -9,11 +9,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-fundamentals-with-light.html | @@ -9,11 +9,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-fundamentals.html | @@ -9,11 +9,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-game-check-animations.html | @@ -73,14 +73,11 @@
</div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/utils/SkeletonUtils.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {SkeletonUtils} from './resources/threejs/r108/examples/jsm/utils/SkeletonUtils.js';
function main() {
const canvas = document.querySelector('#c');
@@ -93,7 +90,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 20, 40);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -130,7 +127,7 @@
knight: { url: 'resources/models/knight/KnightCharacter.gltf' },
};
{
- const gltfLoader = new THREE.GLTFLoader(manager);
+ const gltfLoader = new GLTFLoader(manager);
for (const model of Object.values(models)) {
gltfLoader.load(model.url, (gltf) => {
model.gltf = gltf;
@@ -158,7 +155,7 @@
prepModelsAndAnimations();
Object.values(models).forEach((model, ndx) => {
- const clonedScene = THREE.SkeletonUtils.clone(model.gltf.scene);
+ const clonedScene = SkeletonUtils.clone(model.gltf.scene);
const root = new THREE.Object3D();
root.add(clonedScene);
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-game-conga-line-w-notes.html | @@ -149,15 +149,12 @@
</div>
<div id="labels"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/utils/SkeletonUtils.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {SkeletonUtils} from './resources/threejs/r108/examples/jsm/utils/SkeletonUtils.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -170,7 +167,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 40, 80);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableKeys = false;
controls.target.set(0, 5, 0);
controls.update();
@@ -208,7 +205,7 @@
knight: { url: 'resources/models/knight/KnightCharacter.gltf' },
};
{
- const gltfLoader = new THREE.GLTFLoader(manager);
+ const gltfLoader = new GLTFLoader(manager);
for (const model of Object.values(models)) {
gltfLoader.load(model.url, (gltf) => {
model.gltf = gltf;
@@ -573,7 +570,7 @@
constructor(gameObject, model) {
super(gameObject);
this.model = model;
- this.animRoot = THREE.SkeletonUtils.clone(this.model.gltf.scene);
+ this.animRoot = SkeletonUtils.clone(this.model.gltf.scene);
this.mixer = new THREE.AnimationMixer(this.animRoot);
gameObject.transform.add(this.animRoot);
this.actions = {};
@@ -623,7 +620,7 @@
}
}
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.add(globals, 'debug').onChange(showHideDebugInfo);
gui.close();
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-game-conga-line.html | @@ -149,15 +149,12 @@
</div>
<div id="labels"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/utils/SkeletonUtils.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {SkeletonUtils} from './resources/threejs/r108/examples/jsm/utils/SkeletonUtils.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -170,7 +167,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 40, 80);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableKeys = false;
controls.target.set(0, 5, 0);
controls.update();
@@ -208,7 +205,7 @@
knight: { url: 'resources/models/knight/KnightCharacter.gltf' },
};
{
- const gltfLoader = new THREE.GLTFLoader(manager);
+ const gltfLoader = new GLTFLoader(manager);
for (const model of Object.values(models)) {
gltfLoader.load(model.url, (gltf) => {
model.gltf = gltf;
@@ -498,7 +495,7 @@
constructor(gameObject, model) {
super(gameObject);
this.model = model;
- this.animRoot = THREE.SkeletonUtils.clone(this.model.gltf.scene);
+ this.animRoot = SkeletonUtils.clone(this.model.gltf.scene);
this.mixer = new THREE.AnimationMixer(this.animRoot);
gameObject.transform.add(this.animRoot);
this.actions = {};
@@ -548,7 +545,7 @@
}
}
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.add(globals, 'debug').onChange(showHideDebugInfo);
const labelContainerElem = document.querySelector('#labels'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-game-just-player.html | @@ -79,14 +79,11 @@
</div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/utils/SkeletonUtils.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {SkeletonUtils} from './resources/threejs/r108/examples/jsm/utils/SkeletonUtils.js';
function main() {
const canvas = document.querySelector('#c');
@@ -99,7 +96,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 40, 80);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableKeys = false;
controls.target.set(0, 5, 0);
controls.update();
@@ -137,7 +134,7 @@
knight: { url: 'resources/models/knight/KnightCharacter.gltf' },
};
{
- const gltfLoader = new THREE.GLTFLoader(manager);
+ const gltfLoader = new GLTFLoader(manager);
for (const model of Object.values(models)) {
gltfLoader.load(model.url, (gltf) => {
model.gltf = gltf;
@@ -267,7 +264,7 @@
constructor(gameObject, model) {
super(gameObject);
this.model = model;
- this.animRoot = THREE.SkeletonUtils.clone(this.model.gltf.scene);
+ this.animRoot = SkeletonUtils.clone(this.model.gltf.scene);
this.mixer = new THREE.AnimationMixer(this.animRoot);
gameObject.transform.add(this.animRoot);
this.actions = {}; | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-game-load-models.html | @@ -73,14 +73,11 @@
</div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/utils/SkeletonUtils.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {SkeletonUtils} from './resources/threejs/r108/examples/jsm/utils/SkeletonUtils.js';
function main() {
const canvas = document.querySelector('#c');
@@ -93,7 +90,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 20, 40);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -130,7 +127,7 @@
knight: { url: 'resources/models/knight/KnightCharacter.gltf' },
};
{
- const gltfLoader = new THREE.GLTFLoader(manager);
+ const gltfLoader = new GLTFLoader(manager);
for (const model of Object.values(models)) {
gltfLoader.load(model.url, (gltf) => {
model.gltf = gltf;
@@ -158,7 +155,7 @@
prepModelsAndAnimations();
Object.values(models).forEach((model, ndx) => {
- const clonedScene = THREE.SkeletonUtils.clone(model.gltf.scene);
+ const clonedScene = SkeletonUtils.clone(model.gltf.scene);
const root = new THREE.Object3D();
root.add(clonedScene);
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-game-player-input.html | @@ -119,14 +119,11 @@
</div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/utils/SkeletonUtils.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {SkeletonUtils} from './resources/threejs/r108/examples/jsm/utils/SkeletonUtils.js';
function main() {
const canvas = document.querySelector('#c');
@@ -139,7 +136,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 40, 80);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableKeys = false;
controls.target.set(0, 5, 0);
controls.update();
@@ -177,7 +174,7 @@
knight: { url: 'resources/models/knight/KnightCharacter.gltf' },
};
{
- const gltfLoader = new THREE.GLTFLoader(manager);
+ const gltfLoader = new GLTFLoader(manager);
for (const model of Object.values(models)) {
gltfLoader.load(model.url, (gltf) => {
model.gltf = gltf;
@@ -458,7 +455,7 @@
constructor(gameObject, model) {
super(gameObject);
this.model = model;
- this.animRoot = THREE.SkeletonUtils.clone(this.model.gltf.scene);
+ this.animRoot = SkeletonUtils.clone(this.model.gltf.scene);
this.mixer = new THREE.AnimationMixer(this.animRoot);
gameObject.transform.add(this.animRoot);
this.actions = {}; | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-indexed-textures-picking-and-highlighting.html | @@ -57,13 +57,10 @@
<div id="labels"></div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -76,7 +73,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -425,7 +422,6 @@
controls.update();
-
updateLabels();
renderer.render(scene, camera); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-indexed-textures-picking-debounced.html | @@ -57,13 +57,10 @@
<div id="labels"></div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -76,7 +73,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -453,7 +450,6 @@
controls.update();
-
updateLabels();
renderer.render(scene, camera); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-indexed-textures-picking.html | @@ -57,13 +57,10 @@
<div id="labels"></div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -76,7 +73,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -356,7 +353,6 @@
controls.update();
-
updateLabels();
renderer.render(scene, camera); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-indexed-textures-random-colors.html | @@ -57,13 +57,10 @@
<div id="labels"></div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -76,7 +73,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -402,7 +399,6 @@
controls.update();
-
updateLabels();
renderer.render(scene, camera); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-ambient.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -39,7 +36,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -104,7 +101,7 @@
const light = new THREE.AmbientLight(color, intensity);
scene.add(light);
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'intensity', 0, 2, 0.01);
} | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-directional-w-helper.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -39,7 +36,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -124,7 +121,7 @@
}
updateLight();
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'intensity', 0, 2, 0.01);
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-directional.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -39,7 +36,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -107,7 +104,7 @@
scene.add(light);
scene.add(light.target);
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'intensity', 0, 2, 0.01);
gui.add(light.target.position, 'x', -10, 10); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-hemisphere.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -39,7 +36,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -85,7 +82,6 @@
scene.add(mesh);
}
-
class ColorGUIHelper {
constructor(object, prop) {
this.object = object;
@@ -106,7 +102,7 @@
const light = new THREE.HemisphereLight(skyColor, groundColor, intensity);
scene.add(light);
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('skyColor');
gui.addColor(new ColorGUIHelper(light, 'groundColor'), 'value').name('groundColor');
gui.add(light, 'intensity', 0, 2, 0.01); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-point-physically-correct.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -120,7 +117,7 @@
const helper = new THREE.PointLightHelper(light);
scene.add(helper);
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'decay', 0, 4, 0.01);
gui.add(light, 'power', 0, 1220); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-point.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -39,7 +36,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -120,7 +117,7 @@
helper.update();
}
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'intensity', 0, 2, 0.01);
gui.add(light, 'distance', 0, 40).onChange(updateLight); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-rectarea.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/lights/RectAreaLightUniformsLib.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {RectAreaLightUniformsLib} from './resources/threejs/r108/examples/jsm/lights/RectAreaLightUniformsLib.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -137,7 +134,7 @@
helper.update();
}
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'intensity', 0, 10, 0.01);
gui.add(light, 'width', 0, 20).onChange(updateLight); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lights-spot-w-helper.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -39,7 +36,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -137,7 +134,7 @@
}
updateLight();
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color');
gui.add(light, 'intensity', 0, 2, 0.01);
gui.add(light, 'distance', 0, 40).onChange(updateLight); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-animated-cars.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -167,7 +164,7 @@
const cars = [];
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-car-path-fixed.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -167,7 +164,7 @@
const cars = [];
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-car-path.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -164,7 +161,7 @@
const cars = [];
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-dump-scenegraph-extra.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -134,7 +131,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-dump-scenegraph.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -124,7 +121,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-rotate-cars-fixed.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -113,7 +110,7 @@
const cars = [];
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-rotate-cars.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -113,7 +110,7 @@
let cars;
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf-shadows.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -41,7 +38,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -178,7 +175,7 @@
}
}
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.close();
gui.add(new VisibleGUIHelper(helper, cameraHelper), 'value').name('show helpers');
gui.add(light.shadow, 'bias', -0.1, 0.1, 0.001);
@@ -279,10 +276,9 @@
}
}
-
const cars = [];
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-gltf.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -112,7 +109,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-auto-camera-xz.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -112,7 +109,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.load('resources/models/windmill_2/windmill.obj', (event) => {
const root = event.detail.loaderRootNode;
root.updateMatrixWorld(); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-auto-camera.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -109,7 +106,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.load('resources/models/windmill_2/windmill.obj', (event) => {
const root = event.detail.loaderRootNode;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-materials-fixed.html | @@ -20,15 +20,12 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script src="resources/threejs/r108/js/loaders/MTLLoader.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
+import {MTLLoader} from './resources/threejs/r108/examples/jsm/loaders/MTLLoader.js';
function main() {
const canvas = document.querySelector('#c');
@@ -41,7 +38,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -87,7 +84,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.loadMtl('resources/models/windmill/windmill-fixed.mtl', null, (materials) => {
materials.Material.side = THREE.DoubleSide;
objLoader.setMaterials(materials); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-materials-windmill2.html | @@ -20,15 +20,12 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script src="resources/threejs/r108/js/loaders/MTLLoader.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
+import {MTLLoader} from './resources/threejs/r108/examples/jsm/loaders/MTLLoader.js';
function main() {
const canvas = document.querySelector('#c');
@@ -41,7 +38,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -113,7 +110,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.loadMtl('resources/models/windmill_2/windmill-fixed.mtl', null, (materials) => {
objLoader.setMaterials(materials);
objLoader.load('resources/models/windmill_2/windmill.obj', (event) => { | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-materials.html | @@ -20,15 +20,12 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script src="resources/threejs/r108/js/loaders/MTLLoader.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
+import {MTLLoader} from './resources/threejs/r108/examples/jsm/loaders/MTLLoader.js';
function main() {
const canvas = document.querySelector('#c');
@@ -41,7 +38,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -87,7 +84,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.loadMtl('resources/models/windmill/windmill.mtl', null, (materials) => {
objLoader.setMaterials(materials);
objLoader.load('resources/models/windmill/windmill.obj', (event) => { | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-no-materials.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -87,7 +84,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.load('resources/models/windmill/windmill.obj', (event) => {
const root = event.detail.loaderRootNode;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-load-obj-wat.html | @@ -20,14 +20,11 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/LoaderSupport.js"></script>
-<script src="resources/threejs/r108/js/loaders/OBJLoader2.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {LoaderSupport} from './resources/threejs/r108/examples/jsm/loaders/LoaderSupport.js';
+import {OBJLoader2} from './resources/threejs/r108/examples/jsm/loaders/OBJLoader2.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -87,7 +84,7 @@
}
{
- const objLoader = new THREE.OBJLoader2();
+ const objLoader = new OBJLoader2();
objLoader.load('resources/models/windmill_2/windmill.obj', (event) => {
const root = event.detail.loaderRootNode;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-animated.html | @@ -40,14 +40,13 @@
<canvas id="c"></canvas>
<div id="ui"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/libs/tween.min.js"></script>
-<script>
-'use strict';
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {TWEEN} from './resources/threejs/r108/examples/jsm/libs/tween.module.min.js';
-/* global THREE, TWEEN */
+/* global TWEEN */
class TweenManger {
constructor() {
@@ -92,7 +91,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -217,7 +216,7 @@
});
});
- const mergedGeometry = THREE.BufferGeometryUtils.mergeBufferGeometries(
+ const mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(
geometries, false);
const material = new THREE.MeshBasicMaterial({
vertexColors: THREE.VertexColors, | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-merged-vertexcolors.html | @@ -19,13 +19,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -38,7 +35,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -163,7 +160,7 @@
});
});
- const mergedGeometry = THREE.BufferGeometryUtils.mergeBufferGeometries(
+ const mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(
geometries, false);
const material = new THREE.MeshBasicMaterial({
vertexColors: THREE.VertexColors, | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-merged.html | @@ -19,13 +19,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -38,7 +35,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -139,7 +136,7 @@
});
});
- const mergedGeometry = THREE.BufferGeometryUtils.mergeBufferGeometries(
+ const mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(
geometries, false);
const material = new THREE.MeshBasicMaterial({color:'red'});
const mesh = new THREE.Mesh(mergedGeometry, material); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-morphtargets-w-colors.html | @@ -40,14 +40,11 @@
<canvas id="c"></canvas>
<div id="ui"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/libs/tween.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, TWEEN */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {TWEEN} from './resources/threejs/r108/examples/jsm/libs/tween.module.min.js';
class TweenManger {
constructor() {
@@ -92,7 +89,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -226,7 +223,7 @@
});
});
- return THREE.BufferGeometryUtils.mergeBufferGeometries(
+ return BufferGeometryUtils.mergeBufferGeometries(
geometries, false);
}
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-morphtargets.html | @@ -40,14 +40,11 @@
<canvas id="c"></canvas>
<div id="ui"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/libs/tween.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, TWEEN */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {TWEEN} from './resources/threejs/r108/examples/jsm/libs/tween.module.min.js';
class TweenManger {
constructor() {
@@ -92,7 +89,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -226,7 +223,7 @@
});
});
- return THREE.BufferGeometryUtils.mergeBufferGeometries(
+ return BufferGeometryUtils.mergeBufferGeometries(
geometries, false);
}
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-multiple-data-sets.html | @@ -40,13 +40,10 @@
<canvas id="c"></canvas>
<div id="ui"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/utils/BufferGeometryUtils.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {BufferGeometryUtils} from './resources/threejs/r108/examples/jsm/utils/BufferGeometryUtils.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -59,7 +56,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2;
@@ -184,7 +181,7 @@
});
});
- const mergedGeometry = THREE.BufferGeometryUtils.mergeBufferGeometries(
+ const mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(
geometries, false);
const material = new THREE.MeshBasicMaterial({
vertexColors: THREE.VertexColors, | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-lots-of-objects-slow.html | @@ -19,12 +19,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -37,7 +34,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2.5;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enablePan = false;
controls.minDistance = 1.2; | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-controls.html | @@ -48,12 +48,9 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/TrackballControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {TrackballControls} from './resources/threejs/r108/examples/jsm/controls/TrackballControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -76,7 +73,7 @@
camera.lookAt(0, 0, 0);
scene.add(camera);
- const controls = new THREE.TrackballControls(camera, elem);
+ const controls = new TrackballControls(camera, elem);
controls.noZoom = true;
controls.noPan = true;
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-copy-canvas.html | @@ -43,12 +43,9 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/TrackballControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {TrackballControls} from './resources/threejs/r108/examples/jsm/controls/TrackballControls.js';
function main() {
const canvas = document.createElement('canvas');
@@ -74,7 +71,7 @@
camera.lookAt(0, 0, 0);
scene.add(camera);
- const controls = new THREE.TrackballControls(camera, elem);
+ const controls = new TrackballControls(camera, elem);
controls.noZoom = true;
controls.noPan = true;
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-generic.html | @@ -48,11 +48,8 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-selector.html | @@ -48,11 +48,8 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-v1.html | @@ -48,11 +48,8 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-v2.html | @@ -49,11 +49,8 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-multiple-scenes-v3.html | @@ -49,11 +49,8 @@
and finding a undiscovered tomb full of mummies and treasure.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-offscreencanvas-w-fallback.html | @@ -19,10 +19,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
<script src="shared-cubes.js"></script>
-<script>
-'use strict';
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
/* global state, init */
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-offscreencanvas-w-orbitcontrols.html | @@ -22,11 +22,10 @@
<body>
<canvas id="c" tabindex="1"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
<script src="shared-orbitcontrols.js"></script>
-<script>
-'use strict';
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
/* global init */
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-offscreencanvas-w-picking.html | @@ -19,10 +19,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
<script src="shared-picking.js"></script>
-<script>
-'use strict';
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
/* global state, init, pickPosition */
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-offscreencanvas.html | @@ -31,8 +31,8 @@
<div>no OffscreenCanvas support</div>
</div>
</body>
-<script>
-'use strict';
+<script type="module">
+
function main() { /* eslint consistent-return: 0 */
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-picking-gpu.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-picking-raycaster-complex-geo.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-picking-raycaster-transparency.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-picking-raycaster.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-3dlut-identity.html | @@ -19,18 +19,15 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -43,7 +40,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -92,7 +89,7 @@
const lutSettings = {
lut: lutNameIndexMap.identity,
};
- const gui = new dat.GUI({ width: 300 });
+ const gui = new GUI({ width: 300 });
gui.add(lutSettings, 'lut', lutNameIndexMap);
const scene = new THREE.Scene();
@@ -141,7 +138,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/3dbustchallange_submission/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root);
@@ -225,14 +222,14 @@
fragmentShader: lutShader.fragmentShader.replace('#define FILTER_LUT', '//'),
};
- const effectLUT = new THREE.ShaderPass(lutShader);
+ const effectLUT = new ShaderPass(lutShader);
effectLUT.renderToScreen = true;
- const effectLUTNearest = new THREE.ShaderPass(lutNearestShader);
+ const effectLUTNearest = new ShaderPass(lutNearestShader);
effectLUTNearest.renderToScreen = true;
- const renderModel = new THREE.RenderPass(scene, camera);
+ const renderModel = new RenderPass(scene, camera);
renderModel.clear = false; // so we don't clear out the background
- const renderBG = new THREE.RenderPass(sceneBG, cameraBG);
+ const renderBG = new RenderPass(sceneBG, cameraBG);
renderModel.clear = false;
@@ -241,7 +238,7 @@
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
};
- const composer = new THREE.EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
+ const composer = new EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
composer.addPass(renderBG);
composer.addPass(renderModel); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-3dlut-prep.html | @@ -20,13 +20,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
function main() {
const canvas = document.querySelector('#c');
@@ -40,7 +37,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -90,7 +87,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/3dbustchallange_submission/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-3dlut-w-loader.html | @@ -19,20 +19,19 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
<script src="resources/lut-reader.js"></script>
<script src="resources/drag-and-drop.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat, dragAndDrop, lutParser */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
+
+/* global dragAndDrop, lutParser */
function main() {
const canvas = document.querySelector('#c');
@@ -45,7 +44,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -137,7 +136,6 @@
};
}();
-
lutTextures.forEach((info) => {
// if not size set get it from the filename
if (!info.size) {
@@ -171,7 +169,7 @@
dummy: () => {},
lut: lutNameIndexMap.thermal,
};
- const gui = new dat.GUI({ width: 300 });
+ const gui = new GUI({ width: 300 });
gui.addFolder('Choose LUT or Drag&Drop LUT File(s)');
let lutGUI;
@@ -230,7 +228,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/3dbustchallange_submission/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root);
@@ -314,21 +312,21 @@
fragmentShader: lutShader.fragmentShader.replace('#define FILTER_LUT', '//'),
};
- const effectLUT = new THREE.ShaderPass(lutShader);
+ const effectLUT = new ShaderPass(lutShader);
effectLUT.renderToScreen = true;
- const effectLUTNearest = new THREE.ShaderPass(lutNearestShader);
+ const effectLUTNearest = new ShaderPass(lutNearestShader);
effectLUTNearest.renderToScreen = true;
- const renderModel = new THREE.RenderPass(scene, camera);
+ const renderModel = new RenderPass(scene, camera);
renderModel.clear = false; // so we don't clear out the background
- const renderBG = new THREE.RenderPass(sceneBG, cameraBG);
+ const renderBG = new RenderPass(sceneBG, cameraBG);
const rtParameters = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
};
- const composer = new THREE.EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
+ const composer = new EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
composer.addPass(renderBG);
composer.addPass(renderModel); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-3dlut.html | @@ -19,20 +19,17 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="resources/threejs/r108/js/loaders/GLTFLoader.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
<script src="resources/lut-reader.js"></script>
<script src="resources/drag-and-drop.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import {GLTFLoader} from './resources/threejs/r108/examples/jsm/loaders/GLTFLoader.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -45,7 +42,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 10, 20);
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 5, 0);
controls.update();
@@ -137,7 +134,6 @@
};
}();
-
lutTextures.forEach((info) => {
// if not size set get it from the filename
if (!info.size) {
@@ -166,7 +162,7 @@
const lutSettings = {
lut: lutNameIndexMap.custom,
};
- const gui = new dat.GUI({ width: 300 });
+ const gui = new GUI({ width: 300 });
gui.add(lutSettings, 'lut', lutNameIndexMap);
const scene = new THREE.Scene();
@@ -215,7 +211,7 @@
}
{
- const gltfLoader = new THREE.GLTFLoader();
+ const gltfLoader = new GLTFLoader();
gltfLoader.load('resources/models/3dbustchallange_submission/scene.gltf', (gltf) => {
const root = gltf.scene;
scene.add(root);
@@ -299,21 +295,21 @@
fragmentShader: lutShader.fragmentShader.replace('#define FILTER_LUT', '//'),
};
- const effectLUT = new THREE.ShaderPass(lutShader);
+ const effectLUT = new ShaderPass(lutShader);
effectLUT.renderToScreen = true;
- const effectLUTNearest = new THREE.ShaderPass(lutNearestShader);
+ const effectLUTNearest = new ShaderPass(lutNearestShader);
effectLUTNearest.renderToScreen = true;
- const renderModel = new THREE.RenderPass(scene, camera);
+ const renderModel = new RenderPass(scene, camera);
renderModel.clear = false; // so we don't clear out the background
- const renderBG = new THREE.RenderPass(sceneBG, cameraBG);
+ const renderBG = new RenderPass(sceneBG, cameraBG);
const rtParameters = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBFormat,
};
- const composer = new THREE.EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
+ const composer = new EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
composer.addPass(renderBG);
composer.addPass(renderModel); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-adobe-lut-to-png-converter.html | @@ -30,17 +30,16 @@ <h1>Adobe LUT to PNG converter</h1>
<p><button type="button">Save...</button></p>
<div id="cube"><canvas id="c"></canvas></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
<script src="resources/lut-reader.js"></script>
<script src="resources/drag-and-drop.js"></script>
-<script>
-'use strict';
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
-/* global THREE, dragAndDrop, lutParser */
+/* global dragAndDrop, lutParser */
function main() {
const canvas = document.querySelector('#c');
@@ -160,17 +159,17 @@ <h1>Adobe LUT to PNG converter</h1>
`,
};
- const effectLUT = new THREE.ShaderPass(lutShader);
+ const effectLUT = new ShaderPass(lutShader);
effectLUT.renderToScreen = true;
- const renderBG = new THREE.RenderPass(sceneBG, cameraBG);
+ const renderBG = new RenderPass(sceneBG, cameraBG);
const rtParameters = {
minFilter: THREE.NearestFilter,
magFilter: THREE.NearestFilter,
format: THREE.RGBFormat,
};
- const composer = new THREE.EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
+ const composer = new EffectComposer(renderer, new THREE.WebGLRenderTarget(1, 1, rtParameters));
composer.addPass(renderBG);
composer.addPass(effectLUT); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-custom.html | @@ -19,16 +19,13 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -73,8 +70,8 @@
makeInstance(geometry, 0xaa8844, 2),
];
- const composer = new THREE.EffectComposer(renderer);
- composer.addPass(new THREE.RenderPass(scene, camera));
+ const composer = new EffectComposer(renderer);
+ composer.addPass(new RenderPass(scene, camera));
const colorShader = {
uniforms: {
@@ -101,7 +98,7 @@
`,
};
- const colorPass = new THREE.ShaderPass(colorShader);
+ const colorPass = new ShaderPass(colorShader);
colorPass.renderToScreen = true;
composer.addPass(colorPass);
@@ -116,7 +113,7 @@
return needResize;
}
- const gui = new dat.GUI();
+ const gui = new GUI();
gui.add(colorPass.uniforms.color.value, 'r', 0, 4).name('red');
gui.add(colorPass.uniforms.color.value, 'g', 0, 4).name('green');
gui.add(colorPass.uniforms.color.value, 'b', 0, 4).name('blue'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing-gui.html | @@ -19,20 +19,17 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/shaders/ConvolutionShader.js"></script>
-<script src="resources/threejs/r108/js/shaders/FilmShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/BloomPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/FilmPass.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {ConvolutionShader} from './resources/threejs/r108/examples/jsm/shaders/ConvolutionShader.js';
+import {FilmShader} from './resources/threejs/r108/examples/jsm/shaders/FilmShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
+import {BloomPass} from './resources/threejs/r108/examples/jsm/postprocessing/BloomPass.js';
+import {FilmPass} from './resources/threejs/r108/examples/jsm/postprocessing/FilmPass.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -77,18 +74,18 @@
makeInstance(geometry, 0xaa8844, 2),
];
- const composer = new THREE.EffectComposer(renderer);
- composer.addPass(new THREE.RenderPass(scene, camera));
+ const composer = new EffectComposer(renderer);
+ composer.addPass(new RenderPass(scene, camera));
- const bloomPass = new THREE.BloomPass(
+ const bloomPass = new BloomPass(
1, // strength
25, // kernel size
4, // sigma ?
256, // blur render target resolution
);
composer.addPass(bloomPass);
- const filmPass = new THREE.FilmPass(
+ const filmPass = new FilmPass(
0.35, // noise intensity
0.025, // scanline intensity
648, // scanline count
@@ -108,7 +105,7 @@
return needResize;
}
- const gui = new dat.GUI();
+ const gui = new GUI();
{
const folder = gui.addFolder('BloomPass');
folder.add(bloomPass.copyUniforms.opacity, 'value', 0, 2).name('stength'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-postprocessing.html | @@ -19,19 +19,16 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/shaders/CopyShader.js"></script>
-<script src="resources/threejs/r108/js/shaders/ConvolutionShader.js"></script>
-<script src="resources/threejs/r108/js/shaders/FilmShader.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/EffectComposer.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/RenderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/ShaderPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/BloomPass.js"></script>
-<script src="resources/threejs/r108/js/postprocessing/FilmPass.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {CopyShader} from './resources/threejs/r108/examples/jsm/shaders/CopyShader.js';
+import {ConvolutionShader} from './resources/threejs/r108/examples/jsm/shaders/ConvolutionShader.js';
+import {FilmShader} from './resources/threejs/r108/examples/jsm/shaders/FilmShader.js';
+import {EffectComposer} from './resources/threejs/r108/examples/jsm/postprocessing/EffectComposer.js';
+import {RenderPass} from './resources/threejs/r108/examples/jsm/postprocessing/RenderPass.js';
+import {ShaderPass} from './resources/threejs/r108/examples/jsm/postprocessing/ShaderPass.js';
+import {BloomPass} from './resources/threejs/r108/examples/jsm/postprocessing/BloomPass.js';
+import {FilmPass} from './resources/threejs/r108/examples/jsm/postprocessing/FilmPass.js';
function main() {
const canvas = document.querySelector('#c');
@@ -76,18 +73,18 @@
makeInstance(geometry, 0xaa8844, 2),
];
- const composer = new THREE.EffectComposer(renderer);
- composer.addPass(new THREE.RenderPass(scene, camera));
+ const composer = new EffectComposer(renderer);
+ composer.addPass(new RenderPass(scene, camera));
- const bloomPass = new THREE.BloomPass(
+ const bloomPass = new BloomPass(
1, // strength
25, // kernel size
4, // sigma ?
256, // blur render target resolution
);
composer.addPass(bloomPass);
- const filmPass = new THREE.FilmPass(
+ const filmPass = new FilmPass(
0.35, // noise intensity
0.025, // scanline intensity
648, // scanline count | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-primitives-text.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-primitives.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-render-on-demand-w-damping.html | @@ -19,12 +19,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -37,7 +34,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.target.set(0, 0, 0);
controls.update(); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-render-on-demand-w-gui.html | @@ -19,13 +19,10 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -38,12 +35,12 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.target.set(0, 0, 0);
controls.update();
- const gui = new dat.GUI();
+ const gui = new GUI();
const scene = new THREE.Scene();
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-render-on-demand.html | @@ -19,12 +19,9 @@
<body>
<canvas id="c" tabindex="1"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="resources/threejs/r108/js/controls/OrbitControls.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
function main() {
const canvas = document.querySelector('#c');
@@ -37,7 +34,7 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.z = 2;
- const controls = new THREE.OrbitControls(camera, canvas);
+ const controls = new OrbitControls(camera, canvas);
controls.target.set(0, 0, 0);
controls.update();
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-render-target.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-responsive-editor.html | @@ -22,6 +22,7 @@
#c {
width: 100%;
height: 100%;
+ display: block;
}
.gutter {
background-color: #eee;
@@ -47,12 +48,9 @@
</div>
</div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="threejs-responsive.js"></script>
+<script type="module" src="threejs-responsive.js"></script>
<script src="../3rdparty/split.min.js"></script>
-<script>
-'use strict';
-
+<script type="module">
/* global Split */
// This code is only related to handling the split. | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-responsive-hd-dpi.html | @@ -20,11 +20,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-responsive-no-resize.html | @@ -20,11 +20,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-responsive-paragraph.html | @@ -29,7 +29,6 @@
ut, auctor eget massa.
</p>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script src="threejs-responsive.js"></script>
+<script type="module" src="threejs-responsive.js"></script>
</html>
| true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-responsive-update-camera.html | @@ -20,11 +20,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-responsive.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-car.html | @@ -19,12 +19,9 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
<script src="resources/threejs-lessons-helper.js"></script> <!-- you can and should delete this script. it is only used on the site to help with errors -->
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -106,7 +103,6 @@
camera.updateProjectionMatrix();
}
-
wheelMeshes.forEach((obj) => {
obj.rotation.x = time;
}); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun-earth-moon-axes-grids.html | @@ -45,17 +45,14 @@
<canvas id="c"></canvas>
<div id="ui"></div>
</body>
-<script src="../3rdparty/dat.gui.min.js"></script>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE, dat */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
+import { GUI } from '../3rdparty/dat.gui.module.js';
function main() {
const canvas = document.querySelector('#c');
const renderer = new THREE.WebGLRenderer({canvas});
- const gui = new dat.GUI();
+ const gui = new GUI();
const fov = 40;
const aspect = 2; // the canvas default
@@ -114,9 +111,9 @@
objects.push(moonMesh);
// Turns both axes and grid visible on/off
- // dat.GUI requires a property that returns a bool
+ // GUI requires a property that returns a bool
// to decide to make a checkbox so we make a setter
- // can getter for `visible` which we can tell dat.GUI
+ // can getter for `visible` which we can tell GUI
// to look at.
class AxisGridHelper {
constructor(node, units = 10) { | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun-earth-moon-axes.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun-earth-moon.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun-earth-orbit-fixed.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun-earth-orbit.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun-earth.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-sun.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-scenegraph-tank.html | @@ -29,11 +29,8 @@
<canvas id="c"></canvas>
<div id="info"></div>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-shadertoy-as-texture.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c');
@@ -84,7 +81,6 @@
}
`;
-
const loader = new THREE.TextureLoader();
const texture = loader.load('resources/images/bayer.png');
texture.minFilter = THREE.NearestFilter; | true |
Other | mrdoob | three.js | d2fd74e7b551b049b48e30bf191926aae87291fa.json | use modules in all examples | threejs/threejs-shadertoy-basic-x40.html | @@ -19,11 +19,8 @@
<body>
<canvas id="c"></canvas>
</body>
-<script src="resources/threejs/r108/three.min.js"></script>
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.