Added load progress callback to binary loader.
Turns out it is working better over the real web than on localhost (where it seems loading is too fast for Chrome to pick up UI changes, so it queues them and shows them all just after loading is already finished). Still not working properly - getting length of full content, this seems to be unreliable across browser / server combination. Instead passing to callback JSON object with both total and loaded bytes, so this can be handled in the application layer: { total: bytes_total, loaded: bytes_loaded } To be used e.g. like this: loader.loadBinary( url, function( geometry ) { createScene( geometry ) }, path, updateProgress ); function updateProgress( progress ) { var message = "Loaded "; if ( progress.total ) { message += ( 100 * progress.loaded / progress.total ).toFixed(0) + "%"; } else { message += ( progress.loaded / 1000 ).toFixed(2) + " KB"; } $( "status" ).innerHTML = message; }
Showing
想要评论请 注册 或 登录