How to use the DRACOLoader function from three
Find comprehensive JavaScript three.DRACOLoader code examples handpicked from public code repositorys.
89 90 91 92 93 94 95 96 97
} if (loader instanceof THREE.GLTFLoader) { console.log('Enabling Draco support'); THREE.DRACOLoader.setDecoderPath( 'lib/draco/' ); loader.setDRACOLoader( new THREE.DRACOLoader( manager ) ); } const blobURLs = [];
460
11
4
+ 3 other calls in file
53 54 55 56 57 58 59 60 61
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) gltfLoader.setDRACOLoader(new THREE.DRACOLoader()) objLoader.setLogging(false, false) let textures = {} let characterModels = {}
263
0
2
425 426 427 428 429 430 431 432 433 434
* Sets decoder configuration and releases singleton decoder module. Module * will be recreated with the next decoding call. * @param {Object} config */ DRACOLoader.setDecoderConfig = function ( config ) { var wasmBinary = THREE.DRACOLoader.decoderConfig.wasmBinary; DRACOLoader.decoderConfig = config || {}; DRACOLoader.releaseDecoderModule(); // Reuse WASM binary.
4
26
0
+ 5 other calls in file
112 113 114 115 116 117 118 119 120 121
callback, attributeUniqueIdMap, attributeTypeMap ) { var scope = this; THREE.DRACOLoader.getDecoderModule().then(function (module) { const decoderPromise = module.decoder decoderPromise.then(decoder => { scope.decodeDracoFileInternal( rawBuffer,
3
7
8
+ 224 other calls in file
20 21 22 23 24 25 26 27 28 29
const USDZExporter = require('./USDZExporter') class NodeThreeExporter { constructor() { this.gltfLoader = new THREE.GLTFLoader() this.gltfLoader.setDRACOLoader(new THREE.DRACOLoader()) this.objLoader = new THREE.OBJLoader() this.fbxLoader = new THREE.FBXLoader() this.stlLoader = new THREE.STLLoader() this.gltfExporter = new THREE.GLTFExporter()
3
4
2
GitHub: MichaelPolla/mip-viewer
263 264 265 266 267 268 269 270 271 272
this.setContent(scene, clips); blobURLs.forEach(URL.revokeObjectURL); // See: https://github.com/google/draco/issues/349 // THREE.DRACOLoader.releaseDecoderModule(); resolve(); }, undefined, reject);
0
0
0
+ 11 other calls in file
GitHub: yojik/aframe
17 18 19 20 21 22 23 24 25 26
THREE.Cache.enabled = true; } // TODO: Eventually include these only if they are needed by a component. require('../../vendor/DeviceOrientationControls'); // THREE.DeviceOrientationControls require('three/examples/js/loaders/DRACOLoader'); // THREE.DRACOLoader require('three/examples/js/loaders/GLTFLoader'); // THREE.GLTFLoader require('three/examples/js/loaders/OBJLoader'); // THREE.OBJLoader require('three/examples/js/loaders/MTLLoader'); // THREE.MTLLoader require('three/examples/js/utils/BufferGeometryUtils'); // THREE.BufferGeometryUtils
0
0
0
three.Vector3 is the most popular function in three (22341 examples)