Use FBXLoader of three.module.js

Hi, I’m Korean Developer!

I am using “three.module.js” to use the grammar ‘es6’.

Problem is, I want to use the FBXLoader, but I don’t know how to use it.

In an HTML file

I don't want to add this. Is there any way you can use it only by import? I am Korean, and I am using a translator, so the translation may be unstable. Please understand.

FBXLoader.zip (29.2 KB)

Its a bit old, but you can probably change the recent FBXLoader the same way i changed this one.

You’ll have to change
import * as THREE from 'three'; to import * as THREE from './three.module';
in all .js files

2 Likes

I tried to use the following methods. An error is generated.

import * as THREE from “path/three.module.js”;
import FBXLoad from “path/FBXLoader.js”

Can you write the error message?

First of all, thank you very much!

It’s a little settled.

But, The following error is encountered.

THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js

So I downloaded the ‘inflate.min.js’ and added the line below.
Import {Zlib} from ‘/inflate.min.js’.

But Problem is
SyntaxError: requested module ‘./inflate.min.js’ does not provide an export named ‘Zlib’.
There’s an error like this! What should I do?

I forgot about that, I was including inflate.min.js inside my index.html
<script src="js/inflate.min.js"></script>
I have no idea how to import it directly inside FBXLoader :sweat:

Edit:
I found pako_inflate which is a module,
I can’t test it at the moment but i think it would be something like:

 import * as Zlib from "./pako_inflate"

Thanks you!!
I was forced to add a line to the HTML file, but it was fixed thanks to you.
really Thanks you!!