How to Solve gltf format error after Draco compression

The error message of Google Chrome is as follows:
Uncaught SyntaxError: Unexpected token'<‘

When loading the draco algorithm, the file path was also quoted according to the online method, and the result was an error. I used Parcel to package and build.
dracoLoader.setDecoderPath(” /three/examples/js/libs/draco/gltf/ “);

The solution is to put the files in this directory in static files. Static file directory: /static/gltf

The 3D model is a model built using 3dmax and exported to fbx format files. Use FBX2glTF to convert to gltf

npm install -g FBX2glTF

Then enter node_global\node_modules\fbx2gltf\bin\Windows_NT directory
> .\FBX2glTF.exe -i .\lou.FBX -b -d


Click to view code


Perfect solution, no error is reported, remember to add a slash before and after gltf, if you do not add it, you will still report an error

Similar Posts: