OK, tried several things.
Changes the script so only when actually going over a "border" and action will be called - no better.
Used visible instead of changing alpha value - no better.
Used zorder - and it works - panning without a stutter BUT when loading the images at the beginning it seems the zorder is not used?? The images come up one after another and then the one with the highest zorder comes to the top again. Changed order there or tried to make them visible afterwards but that didn't change anything.
In Chrome with developer tools switched on it makes a big difference if I do a "Empty Cache and Hard Reload" - doing that it properly cycles through all images (which is not nice).
So all in all - alpha change or visible change cause a "performance" hit which makes the panning stutter but just changing zorder does not???
But why then does it work OK with visible and alpha change when you panned around 360 degrees once?? Is it then all cached which speeds things up ??
I am still at a loss.
Put the second example also up - hope it works - cubeswitchzorder <-- loading "problem" cycles through images but panning all the way around is smooth with image change
The first example is still out - cubeswitch <-- problem there is that once you try panning past 90,180,270,0 it stutters the first time round - second time round everything is fine.
xml of cubeswitchzorder is attached
All my tries of using alpha, visible or force visibility are in but commented out.
Has anybody an idea why alpha/visible would create the stutter??
And - I don't mind going down the zorder route but how do I prevent the images from cycling trough at the beginning.
The idea is to have 16 or 32 images - not fully equirectangular but only "slices" (180 degrees vertical and perhaps 30 degrees wide) so any cycling through all whilst loading is not wanted - neither the stutter.
Again - any ideas welcome.
Cheers.
<krpano>
<images number="4" dirname="." filename="Smog" />
<!--<images number="8" dirname="." filename="pano" />-->
<!-- the startup viewing settings -->
<view hlookat="0" vlookat="0" fovtype="HFOV" fov="100" fovmin="50" fovmax="150" />
<!-- autorotation -->
<autorotate enabled="false" waittime="3.0" />
<!--<autorotate enabled="true"
waittime="3.0"
speed="10.0"
horizon="0.0"
/>-->
<!-- title text-->
<layer name="title" url="%SWFPATH%/plugins/textfield.swf" align="top" width="90%" y="5%" html=" " background="false" css="text-align:center; font:Arial; font-size:20px; font-weight:bold; font-style:italic; color:#FFFFFF;" textshadow="2" enabled="false" />
<!-- the action/code starts here -->
<action name="start" autorun="onstart">
div(slicedegree,360,images.number);
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));
mul(end,k,slicedegree);
sub(start,end,slicedegree);
set(end_a[a].item[get(k)].value, get(end));
set(start_a[a].item[get(k)].value, get(start));
);
<!-- trace(not all visible);
for(set(t,1),t LE images.number,inc(t),
cubevisible(get(t),true);
); -->
def(currpano,integer,3); <!-- set to "wrong" number so refresh will happen on first go -->
trace(only once);
</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']);
<!-- trying to force only face_1_x to have a high zorder and all the other ones low to prevent image cycling on loading but no luck-->
indexoftxt(ind,'%1','1');
if(ind != -1,
set(hs.zorder, 5);
,
set(hs.zorder,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.visible, true);
set(hs.alpha, 1.0);
</action>
<events name="switchcubes" onviewchange="switchcubes();"
/>
<action name="switchcubes">
add(pan, view.hlookat, 0.5);
mod(pan,360);
if(pan LT 0,
add(pan,360);
);
for(def(i,integer,1), i LE images.number, inc(i),
if(pan GE start_a[a].item[get(i)].value,
if (pan LT end_a[a].item[get(i)].value,
if(currpano != i,
trace(i);
<!--forloopalpha(get(i));-->
<!--forloopvisible(get(i));-->
forloopzorder(get(i));
set(currpano,get(i));
);
);
);
);
</action>
<action name="forloopalpha">
for(set(m,1), m LE images.number, inc(m),
if(m EQ %1,
setcubealpha(get(m),1);
,
setcubealpha(get(m),0);
);
);
</action>
<action name="forloopvisible">
<!--trace('active pano: ',%1);-->
for(set(m,1), m LE images.number, inc(m),
if(m EQ %1,
cubevisible(get(m),true);
,
cubevisible(get(m),false);
);
);
</action>
<action name="forloopzorder">
for(set(m,1), m LE images.number, inc(m),
if(m EQ %1,
setcubezorder(get(m),5);
,
setcubezorder(get(m),1);
);
);
</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>
<action name="cubevisible">
set(hotspot[face_%1_l].visible, %2);
set(hotspot[face_%1_f].visible, %2);
set(hotspot[face_%1_r].visible, %2);
set(hotspot[face_%1_b].visible, %2);
set(hotspot[face_%1_u].visible, %2);
set(hotspot[face_%1_d].visible, %2);
</action>
<action name="setcubezorder">
set(hotspot[face_%1_l].zorder, %2);
set(hotspot[face_%1_f].zorder, %2);
set(hotspot[face_%1_r].zorder, %2);
set(hotspot[face_%1_b].zorder, %2);
set(hotspot[face_%1_u].zorder, %2);
set(hotspot[face_%1_d].zorder, %2);
</action>
</krpano>
Display More