i was watching a youtube tutorial for displaying a gltf model. when i executed the program instead of displaying the model the scene.bin file is getting downloaded.
this is the source code of it
and this is the error i get on the console
I tried with a model which is available on the three.js.master ( damaged helmet) that file was working (till this stage) but this file is not working the file is a house downloaded from sketchfab.
thanks in advance
Can you please share the
glTF asset in this topic?
It is the gltfloader which was available in the official download of three.ja-master from the threejs website
GLTFLoader.js (81.7 KB)
The term “asset” does not refer to the loader but the
glTF 3D model. So I was actually asking you to share
scene.gltf and the respective
bin file (and all related textures)^^.
(38.5 KB) scene.gltf
sorry for the mistake here are the assets you asked for
I’ve added the asset into the official repository and used it in this example:
This is the result:
bin file is not loaded correctly on your computer, there might be some issues with your web server.
Thanks for looking into it and whats the step to make it work properly to the code on the above
I’ve just loaded the house model instead of the damaged helmet in
webgl_loader_gltf. And also reduced the scale of the scene like so:
gltf.scene.scale.multiplyScalar( 0.001 );
I took the code
and executed on my device the damaged helmet is working but if i try to execute the same piece of code with any other model which is present in the model directory in three.js-master or any model from the sketchfab the bin file is getting downloaded
i use visual code live server
When you say “the bin file is getting downloaded”, do you mean that you’re seeing the error you pasted above,
Failed to load buffer "scene.bin"? The
.gltf file requires the
.bin file, and they both need to be hosted in the same directory on your web server. The error means that the application looked for the
.bin file but could not find it. This might mean your webserver isn’t hosting it, or it’s in the wrong folder, or something has been renamed.
Your easiest workaround might be to pack the two files into one
.glb using glTF-Pipeline or https://glb-packer.glitch.me/, then you only have one file to worry about. GLTFLoader can load
.glb files too.
Can you please try it with the web server of the repository? Just type
npm start in the root directory and then test the modified
I remember that certain web servers have issues with mime type configuration so they apply wrong HTTP response header to certain files (which are then accidentally downloaded).