Show .obj Loading Progress Detect

Sometimes, .obj and .mtl files are very big (GB Level).
Before Completely Downloading .obj file… it may takes few minutes (and user will see blank page before showing).

Is there any function we can use to show loading progress(ex:30%…) or Something we can use bofore loading to inform user to wait …

Thank you

This topic might be helpful:

2 Likes

You can use the THREE.LoadingManager giving you the completed items progress like @Mugen87 suggested, but unless you stream or have a config on server side you won’t know how much is downloaded of a single file, so if a single one is large it might look like it’s stuck for a progressbar.

It can help serving those as smaller chunks, having a server side config so you can get that information or use some psychologically working loading visualization like something spinning with some progress texts, it can keep people more patient like instead having a 0-100 progress bar that loads a giant file at the beginning looking like it’s stuck.

1 Like

Using the onProgress callback for the loaders can also provide more granular load progress information:

const loader = new OBJLoader( manager );
loader.load(
  obj => {

    // complete...

  },
  progress => {

    if ( progress.lengthComputable ) {

      const percentageLoaded = progress.loaded / progress.total;
      // ...

    }

  }
);

It might be nice if this were bubbled up to the LoadingManager, as well, for cases where larger files are downloaded.

3 Likes

I was also looking for this too, thanks for the info.