snout-o / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

How to check if the viewer is initialized complete? #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi all,

I would like to ask if there are any ways to check if the viewer is initialized 
complete after the first viewer.init() and update() call.

Since it seems to be async functions, so if I want to change object/texture 
before it is loaded complete errors occur. Are there any callbacks or checking 
to check if the canvas is inited as is ready?

Original issue reported on code.google.com by passerby...@gmail.com on 17 Dec 2013 at 8:37

GoogleCodeExporter commented 9 years ago
The viewer instance provides a set of callbacks that can be overridden to watch 
loading status of a model:

  viewer.onloadingstarted() - this will be called immediately as a new loading is started.

  viewer.onloadingprogress(task, prog) - this sends out progress info when a loading is underway. The 1st parameter is a description of current loading; the 2nd is a number between 0 and 1.

  viewer.onloadingcomplete() - this will be called when a model is loaded completely.

  viewer.onloadingaborted() - this will be called as the previous loading is aborted.

  viewer.onloadingerror(errorMsg) - this will be called when error occurred in the previous loading with an error message.

Override these to get notifications of loading status.

Original comment by Humu2...@gmail.com on 17 Dec 2013 at 4:38

GoogleCodeExporter commented 9 years ago
Hi Humu,

Checked on these functions, but it seems that they are not included in the IE 
(<=8) version (jsc3d_ie.js), which that flash takes really a long time to setup 
and load.

Any workaround can deal with this?

Original comment by passerby...@gmail.com on 18 Dec 2013 at 3:37

GoogleCodeExporter commented 9 years ago
jsc3d_ie.js is not a strick equivalent of jsc3d.js for IE <=8. It suffers 
painful performance drop caused by both the additional flash intermediate layer 
and the inefficient JS engine in old IEs. 

Now this branched edition is there only for maintenance purpose. Maybe there 
will still be some bug-fixes. But it is unlikely to be updated with any new 
feature.

Original comment by Humu2...@gmail.com on 18 Dec 2013 at 4:43