How to use the LoadingManager function from three
Find comprehensive JavaScript three.LoadingManager code examples handpicked from public code repositorys.
GitHub: wkentaro/morefusion
27 28 29 30 31 32 33 34 35
var renderer = new THREE.WebGLRenderer(); renderer.setSize(div.offsetWidth, div.offsetWidth / 640 * 480); div.appendChild(renderer.domElement); var manager = new THREE.LoadingManager(); var onProgress = function(xhr) {}; var onError = function() {};
51
209
21
58 59 60 61 62 63 64 65 66
const baseURL = THREE.Loader.prototype.extractUrlBase(url); return new Promise((resolve, reject) => { const manager = new THREE.LoadingManager(); // Intercept and override relative URLs. manager.setURLModifier((url, path) => {
460
11
4
GitHub: KleoPetroff/storyboarder
7 8 9 10 11 12 13 14 15
const buildSquareRoom = require('./build-square-room') const onlyOfTypes = require('./only-of-types') require('three/examples/js/loaders/GLTFLoader') require('../vendor/three/examples/js/loaders/OBJLoader2') const loadingManager = new THREE.LoadingManager() const objLoader = new THREE.OBJLoader2(loadingManager) const gltfLoader = new THREE.GLTFLoader(loadingManager) const imageLoader = new THREE.ImageLoader(loadingManager)
263
0
2
48 49 50 51 52 53 54 55 56 57
}) const Zlib = require("../vendor/three/examples/js/libs/inflate.min") window.Zlib = Zlib.Zlib let loadingManager = new THREE.LoadingManager() let loader = new THREE.JDLoader() let fbxLoader = new THREE.FBXLoader(loadingManager) let objLoader = new THREE.OBJLoader2(loadingManager) let gltfLoader = new THREE.GLTFLoader(loadingManager)
263
0
2
GitHub: nim65s/meshcat
158 159 160 161 162 163 164 165 166 167
parseObject(json, geometries, materials) { if (json.type == "_meshfile_object") { let geometry; let material; let manager = new THREE.LoadingManager(); let path = ( json.url === undefined ) ? undefined : THREE.LoaderUtils.extractUrlBase( json.url ); manager.setURLModifier(url => { if (json.resources[url] !== undefined) { return json.resources[url];
35
0
1
363 364 365 366 367 368 369 370 371 372
this.renderer.domElement.style.opacity = 1; element.appendChild(this.renderer.domElement); // When loading external assets, this will help us know when // everything is loaded. this.loadingManager = new THREE.LoadingManager(); this.loadingManager.onLoad = this.onLoad.bind(this); // Load the Android model by fetching it from the server. const loader = new THREE.ObjectLoader(this.loadingManager);
1
11
1
315 316 317 318 319 320 321 322 323 324
output = JSON.stringify(output, null, '\t'); output = output.replace(/[\n\t]+([\d\.e\-\[\]]+)/g, '$1'); toZip['app.json'] = fflate_module_1.strToU8(output); // const title = config.getKey('project/title'); const manager = new THREE.LoadingManager(function () { const zipped = fflate_module_1.zipSync(toZip, { level: 9 }); const blob = new Blob([zipped.buffer], { type: 'application/zip' }); save(blob, (title !== '' ? title : 'untitled') + '.zip'); });
1
3
0
+ 2 other calls in file
GitHub: J7778/TEST_HTML_WRK
31 32 33 34 35 36 37 38 39 40 41 42
scene.add(Light); const loadingBarElement = document.querySelector('.loading-img') const loadingBar = document.querySelector('.loading-bar') const overlayLoader = document.querySelector(".loading-overlay") const loadingManager = new THREE.LoadingManager( () => {
0
0
0
+ 4 other calls in file
1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
return Promise.resolve(sourceURI) .then(function (sourceURI) { // Load Texture resource. const loadingManager = new THREE.LoadingManager(); var loader = loadingManager.getHandler(sourceURI); if (!loader) { loader = textureExtensions[EXTENSIONS.MSFT_TEXTURE_DDS]
0
0
0
+ 7 other calls in file
38 39 40 41 42 43 44 45 46 47 48 49
var letterMaterials = {}; var letterMeshes = {}; var letterGroup = new THREE.Group(); var letterObjects = {}; var loadingManager = new THREE.LoadingManager(); // Amount of space on each axis between each letter var separation = new THREE.Vector3(50, 0, 15);
0
0
0
136 137 138 139 140 141 142 143 144 145
document.body.appendChild(renderer.domElement); var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.set(0, 1, 13); const loadingManager = new THREE.LoadingManager( () => { const loadingScreen = document.getElementById( 'loading-screen' ); loadingScreen.classList.add( 'fade-out' );
0
0
2
+ 12 other calls in file
three.Vector3 is the most popular function in three (22341 examples)