How to use the FBXLoader function from three

Find comprehensive JavaScript three.FBXLoader code examples handpicked from public code repositorys.

30
31
32
33
34
35
36
37
38
39

        this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;

};

Object.assign( THREE.FBXLoader.prototype, {

        load: function ( url, onLoad, onProgress, onError ) {

                var self = this;
fork icon8
star icon3
watch icon2

+ 17 other calls in file

50
51
52
53
54
55
56
57
58
59
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)
gltfLoader.setDRACOLoader(new THREE.DRACOLoader())
objLoader.setLogging(false, false)
fork icon263
star icon0
watch icon2

22
23
24
25
26
27
28
29
30
31
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()
    this.usdzExporter = new USDZExporter()
  }
fork icon3
star icon4
watch icon2

542
543
544
545
546
547
548
549
550
551
var onError = function( xhr ) {
	console.error( xhr );
};
//var loader = new THREE.ObjectLoader();
var loader = new THREE.ColladaLoader( manager );
//var loader = new THREE.FBXLoader( manager ); // create a new loader to load collada files and use the download manager
loader.load( myScene.fileToLoad , 
function( object ) {
	console.log(object);
	myScene.scene.add( object.scene ); //object for FBX, object.scene for dae / open collada																															
fork icon0
star icon0
watch icon0

+ 2 other calls in file

33
34
35
36
37
38
39
40
41
42
  scene.add(ambientLight)

  const directionalLight = new THREE.DirectionalLight(0xffffff, 1)
  scene.add(directionalLight)

  new THREE.FBXLoader().load('./assets/animation/raptor_fbx/source/scene.fbx', onLoad, null, console.log)
  // new THREE.FBXLoader().load('./assets/animation/raptor_fbx/scene.fbx', onLoad, null, console.log)
}
function fitCamera(object) {
  const bbox = new THREE.Box3().setFromObject(object)
fork icon0
star icon0
watch icon4

+ 7 other calls in file

49
50
51
52
53
54
55
56
57
58
const gridHelper = new THREE.GridHelper(10,20)
gridHelper.rotation.x = Math.PI / 2
scene.add(gridHelper)

if (file.split('.').slice(-1).toString() === 'fbx') {
  new THREE.FBXLoader().load(file, onLoad, null, console.log)
} else {
  new THREE.GLTFLoader().load(file, onLoad, null, console.log)

}
fork icon0
star icon0
watch icon4

+ 7 other calls in file

Other functions in three

Sorted by popularity

function icon

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