Hi,
I am trying to use krpano to do something to PanoMoments or Photosynth.
I am loading (in this example/ configurable) 4 panoramas as cube faces and depending on panning (where you look) it switches every 90 degrees (360/4) from one panorama to the next.
Everything is working fine - all the cube faces are loaded on startup and I can drag the pano with the mouse
So far so good
BUT
The first time one of the 90 degree pans is reached there is a delay when it switches to the other panorama - ONLY THE FIRST TIME.
I checked with the network monitor but there is no loading happening.
Tried to figure it out with the performance monitor in Chrome and that shows that the first time there is a spike in "painting"
Once all the borders have been "painted" once it is all smooth but not the first time round.
As I said - the example is only 4 panoramas but I wanted to use it with 16/32 and then the stutter the first time round makes it quite unusable
I have tried smaller tiles but it doesn't make a difference (smallest I tried was 512x512 and it still had this delay).
Anybody any idea?
You can see the example here under https://playingwithstuff.000webhostapp.com/cubeswitch/cubeswitch.html
The 4 images are the same pano just getting darker - so if you look around at 90 degrees the first time it will "hang" - from then on there is no problem.
I have attached the XML - perhaps I am doing something silly ??
Any ideas are appreciated.
Cheers.
<krpano>
<!-- the blending offset and overlap range in degrees -->
<images number="4" dirname="." filename="Smog" />
<!-- the startup viewing settings -->
<view hlookat="0" vlookat="0" fovtype="HFOV" fov="100" fovmin="50" fovmax="150" />
<!-- autorotation -->
<autorotate enabled="false" waittime="3.0" />
<!-- the action/code starts here -->
<action name="start" autorun="onstart">
for(set(k,1), k LE images.number, inc(k),
set(name_l, calc:images.dirname +""+images.filename + k + "_l.jpg");
set(name_f, calc:images.dirname +""+images.filename + k + "_f.jpg");
set(name_r, calc:images.dirname +""+images.filename + k + "_r.jpg");
set(name_b, calc:images.dirname +""+images.filename + k + "_b.jpg");
set(name_u, calc:images.dirname +""+images.filename + k + "_u.jpg");
set(name_d, calc:images.dirname +""+images.filename + k + "_d.jpg");
addcube(get(k),get(name_l),get(name_f),get(name_r),get(name_b),get(name_u),get(name_d));
);
</action>
<action name="addcube">
addface('face_%1_l', '%2', -90, 0);
addface('face_%1_f', '%3', 0, 0);
addface('face_%1_r', '%4', +90, 0);
addface('face_%1_b', '%5', +180, 0);
addface('face_%1_u', '%6', 0, -90);
addface('face_%1_d', '%7', 0, +90);
</action>
<action name="addface">
addhotspot('%1');
copy(hs, hotspot['%1']);
set(hs.url, '%2');
set(hs.ath, %3);
set(hs.atv, %4);
set(hs.width, 1000);
set(hs.height, 1000);
set(hs.distorted, true);
set(hs.enabled, false);
set(hs.alpha, 0.0);
</action>
<events name="switchcubes"
onviewchange="switchcubes();"
/>
<action name="switchcubes">
roundval(view.hlookat);
add(pan, view.hlookat, 0);
mod(pan,360);
div(slicedegree,360,images.number);
if(pan LT 0,
add(pan,360);
);
for(set(i,1), i LE images.number, inc(i),
mul(end,i,slicedegree);
sub(start,end,slicedegree);
<!--trace(start);-->
if(pan GE start,
if (pan LT end,
forloopalpha(get(i));
);
);
);
</action>
<action name="forloopalpha">
for(set(i,1), i LE images.number, inc(i),
if(i EQ %1,
setcubealpha(get(i),1);
,
setcubealpha(get(i),0);
);
);
</action>
<action name="setcubealpha">
set(hotspot[face_%1_l].alpha, %2);
set(hotspot[face_%1_f].alpha, %2);
set(hotspot[face_%1_r].alpha, %2);
set(hotspot[face_%1_b].alpha, %2);
set(hotspot[face_%1_u].alpha, %2);
set(hotspot[face_%1_d].alpha, %2);
</action>
</krpano>
Display More