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')});
fork icon460
star icon11
watch icon4

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) {
fork icon3
star icon4
watch icon2

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')
// ---------------------
fork icon2
star icon6
watch icon1

+ 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);
        });
}
fork icon1
star icon8
watch icon2

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 = [];
fork icon0
star icon2
watch icon0

+ 3 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)