You are not logged in.

1

Monday, September 26th 2016, 1:59pm

VTOUR: how to pre-download the cube faces of scene_2 just after scene_1 is loaded

Hi,

Consider a VTOUR with two scenes (so two pano images to load) and where the first scene to be loaded is scene_1. I've noticed that the 6 cube faces of scene_2 are downloaded from the server when the user click to view scene_2.

Instead, I need to pre-download the 6 cube faces just after the 6 cube faces have been downloaded (at least for my application, I know in advance that the user will have to load scene_2, so it's much better to pre-download the 6 cube faces of scene_2 while he/she is spending time on scene_1, rather than let him/her wait later).

How can I do that?

Thanks

2

Monday, September 26th 2016, 9:54pm

There is already a post very well related to my question : How to preload panorama source images?
where it was suggested to use this code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<action name="preloadimage">

  <!-- 1. parameter = internal ID,  2. parameter = url -->

  addplugin(pre_%1);

  set(plugin[pre_%1].visible, false);

  set(plugin[pre_%1].onloaded, trace(preload %2 done);removeplugin(pre_%1) );

  set(plugin[pre_%1].url, %2);

  trace(starting preloading %2);

</action>

<action name="preloadpano1">

  preloadimage(pano1_l, pano1/cube_l.jpg);

  preloadimage(pano1_f, pano1/cube_f.jpg);

  preloadimage(pano1_r, pano1/cube_r.jpg);

  preloadimage(pano1_b, pano1/cube_b.jpg);

  preloadimage(pano1_u, pano1/cube_u.jpg);

  preloadimage(pano1_d, pano1/cube_d.jpg);

</action>
 <events onloadcomplete="preloadpano1();" />



This actually seems to work but this solution was written on January 11th 2010, so I'm wondering whether this is still ok in 2016.


Thanks

3

Tuesday, September 27th 2016, 9:57am

maybe the paths are wrong, but otherwise it looks like it would work.

but how would we do smth like this for multires panos?

4

Tuesday, September 27th 2016, 10:57am

You're right: to make it work I added %SWFPATH%. In my specific case, %SWFPATH%/panos/2.tiles/pano_l.jpg
For the multires something has been said here: How to preload panorama source images?