[SOLVED] Loading GLTF/FBX models from url (www)

Hi there, i am trying to load models remotely using fbx, gltf and glb file type models, currently i have successfully loaded glb models using an external github raw link, but couldnt find out yet how to do so for fbx and gltf. Currently i am trying first with gltf, and i saw from other forums i need to convert it to glb also? But i have no clue how to do that :frowning: Currently i am using a script i found in forums to try and load gltf model, but it shows errors from it, so i am guessing it doesn’t take in www urls. And if i try and use it on the “load glb” script it says invalid magic number. And the other gltf loader script i am currently trying to use showing 404 error although i included the “textures” folder in github. I am still kinda new to scripting for playcanvas too :sweat: Thanks in advance for any assistance.

Project link: PlayCanvas | HTML5 Game Engine
Github raw link - glb: https://raw.githubusercontent.com/AdmiralJohn/Test/main/urban.glb
gltf: “same link as above”.gltf
fbx: “same as above”.fbx

image error for using glb loader for gltf:
image error for 404 errors:

Hi @Admiral_John and welcome,

I’ve tried your .gltf on the PlayCanvas Viewer and some other viewers and it fails to load. Is there a chance it’s not valid?

Also check this post, it may be related: [SOLVED] Load gltf files from URL

hi there, i tried to just click on my own github raw links and it downloads the gltf fine on my pc, but i just think the gltf loader doesnt work at all

I gave it a try on Blender and it throws an error scene.bin missing resource:

ah i see, so it will need a .bin resource included too?

I think so, since it’s referenced in the .gltf:


alright i changed and added the bin file, im gonna try on my end now too

1 Like

Helpful stackoverflow post: aframe - Gltf model texture and scene bin not found - Stack Overflow

1 Like

also i’ve seen this post before, but i’m not so sure from the link its not related to what i’m trying to do :sweat:

Well if you are trying to load this file remotely from a server, then you need to either back everything in a single container (e.g. in a GLB), or make sure the remote relative/absolute urls to any resources referenced (e.g. scene.bin) are valid (can be access from the url).

In addition for the PlayCanvas side you will have to implement the various processBuffer per source methods to make sure you are loading these remote references (check this forum topic I shared above).

1 Like

yes! so for gltf i will need to have a .bin apprently, but for fbx i saw i will need to convert it into a JSON to load it from a server?

JSON is the older PlayCanvas format (legacy), for FBX it’s better to convert it to GLB to load it remotely.

oh, so its not an option to load an FBX externally? or i will have to use scripts to convert it somehow if its possible?

Yes you can’t load an FBX on runtime. The FBX file format isn’t suitable for real time loading/processing, it’s mostly meant for model exchanging.

You can only import an FBX in the PlayCanvas editor and it will automatically convert to GLB.

ah i see, thanks for the info!