How to use the GLTFExporter function from three
Find comprehensive JavaScript three.GLTFExporter code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15 16
} exportContent ( content, extension = 'glb' ) { return new Promise((resolve, reject) => { const exporter = new THREE.GLTFExporter(); const scene = content.scene || content.scenes[0]; console.log('Exporting three.js scene to ' + extension + ' format'); console.log(scene); exporter.parse(scene, resolve, {binary: (extension == 'glb')});
460
11
4
24 25 26 27 28 29 30 31 32 33
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() this.usdzExporter = new USDZExporter() } getLoader(format) {
3
4
2
1 2 3 4 5 6 7 8 9 10
const rhino3dm = require('rhino3dm') const THREE = require('three') // --------------------- // https://gist.github.com/donmccurdy/9f094575c1f1a48a2ddda513898f6496 // needed to support THREE.GLTFExporter const { Blob, FileReader } = require('vblob') global.THREE = THREE require('three/examples/js/exporters/GLTFExporter') // ---------------------
2
6
1
+ 3 other calls in file
81 82 83 84 85 86 87 88 89 90
function render() { manager.update(); } function exportModel(subject, fileName){ let exporter = new THREE.GLTFExporter(); exporter.parse(subject, (obj) => { downloadGLTF(obj, fileName); }); }
1
8
2
GitHub: eic/root2cad
1470 1471 1472 1473 1474 1475 1476 1477 1478 1479
outputJSON.animations = []; } clip = THREE.GLTFExporter.Utils.mergeMorphTargetTracks( clip.clone(), root ); var tracks = clip.tracks; var channels = []; var samplers = [];
0
2
0
+ 3 other calls in file
three.Vector3 is the most popular function in three (22341 examples)