This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > May 2004 > Re: Loading question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Loading question
Paul Aslin

2004-05-16, 7:28 am

Yes this trick does work.

One thing is you need to wrap the Script containing createVrmlFromUrl
in a PROTO so as to force the browser to run it in a seperate thread.
Otherwise weird things happen.

Anyway have a look at the Cave Game and Find Crystals game here.
http://www.vrmlworlds.com/games/

mdk <antispam_mdk@gazeta.pl> wrote in message news:<c78pu1$q31$1@korweta.task.gda.pl>...
>
> Use functions from Browser object. Like 'createVrmlFromUrl' (or
> something like that..).
>
> If your world consists of many files you can take advantage of the fact
> that almost every vrmlbrowser caches downloaded files.
> So you can do something like (it's just a general idea):
>
> createVrmlFromUrl(.., 'file1.wrl',callbackFn1);
> createVrmlFromUrl(.., 'file2.wrl',callbackFn1);
> createVrmlFromUrl(.., 'file3.wrl',callbackFn1);
> ...
> createVrmlFromUrl(.., 'fileN.wrl', callbackFn1);
> and finally:
> createVrmlFromUrl(.., 'mainFile.wrl',callbackFn2);
> ..
> and somewhere:
> replaceWorld(myFile);
>
>
> All files loaded this way will be cached, so when they are really needed
> they'll be taken from your harddisk and not from the internet.
>
> If you use this way of preloading, it's easy to make a progress bar, or
> just write on the screen something like '55% loaded' (55 is an example).
> Namely you can update this text in callback functions.
> When all files are loaded then just execute replaceworld(newWorld)...
>
> I haven't used this method yet :) but I'll try it myself in my world and
> I think it should work.
>
> md

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews