Forum

Preloader on Dynamic Object Loading

11 August 2017 08:26
Hi all ,

I'm Dynamically adding 3D objects to my project ..
Am i able to add a preloader ( 0 - 100% percentage wise ) while adding the object ..

Because , when i'm adding a 3D object to the scene , it takes little time and user is not able to know whether the program is working or not

Thanks in Advance ..
11 August 2017 09:16
One of the parameters for the load() function is a progress callback called StageloadCallback(). You could pull data from this for some kind of progress animation.
Another option I have been thinking of trying is make a little animated hourglass or a simple spinning gif animation on a plane. Then hide it with the loaded_cb in the load() function.
11 August 2017 09:27
Thank you very much Will :) .. That was a great Solution .. Worked Nice
27 September 2017 08:24
Hi guys-

I've got the same question but I can't figure out how to actually display the progress bar on the scene somewhere.

Do you have an example of this that I could look at?

Thanks!
28 September 2017 10:44
Hi, there's no example, but it should be pretty easy.
If you load your scene like this:
m_data.load("my_scene.json");

then you can supply it with the standard preloader:
m_preloader.create_preloader();
m_data.load("my_scene.json", null, function(percentage) {
    m_preloader.update_preloader(percentage);
});
 
Please register or log in to leave a reply.