This has been posted before, with a response from Klaus. post
I am hoping there is an updated, or better way of accomplishing this with adjusthlookat or something. I wanted to do a daytime to nighttime to daytime transition when the user reached a certain horizontal point... ie around hlookat 0. It works fine if the user swings the pano left and back to the right, but if the user continues around and around in same direction, hlookat goes beyond 360 degree count and continues indefinitely with user persistence, thereby never reaching near the 0 value again.
I am using cubeface hotspots that turn on/off inside the daytime scene to show/hide the nighttime scene.
Test here... move right, then left, then right... but full rotate not work.
test
xml
Ideas? Suggestions? Help? Advice? Criticism?
<krpano version="1.16" onstart="showlog(); set(counter, 0); startup();">
<events onviewchange="transition();" />
<action name="transition">
if(counter == 0,
if(view.hlookat GE 0,
if(view.hlookat LT 1.0,
delayedcall(1.0, changetonight(); );
);
);
);
if(counter == 1,
if(view.hlookat GE 0,
if(view.hlookat LT 1.0,
delayedcall(1.0, changetoday(); );
);
);
);
</action>
<action name="changetonight">
set(counter, 1); if(counter == 1, stopall(););
for(set(i, 1), i LE 6, inc(i),
txtadd(night, 'hot_', get(i));
set(hotspot[get(night)].visible, true);
tweenhsalpha(get(night), 1.0);
);
trace(Its Night);
</action>
<action name="changetoday">
set(counter, 0); if(counter == 0, stopall(););
for(set(i, 1), i LE 6, inc(i),
txtadd(day, 'hot_', get(i));
set(hotspot[get(day)].visible, true);
tweenhsalpha(get(day), 0.0);
);
trace(Its Day);
</action>
<action name="tweenhsalpha">
tween(hotspot[%1].alpha,%2, 1.0);
</action>
<action name="startup">
loadscene(scene_day, null, MERGE);
</action>
<scene name="scene_day" title="day" onstart="" thumburl="panos/day.tiles/thumb.jpg" lat="" lng="" heading="">
<view hlookat="-1" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />
<preview url="panos/day.tiles/preview.jpg" />
<image>
<cube url="panos/day.tiles/pano_%s.jpg" />
<mobile>
<cube url="panos/day.tiles/mobile_%s.jpg" />
</mobile>
</image>
<style name="cubeface" width="1002" height="1002" distorted="true" enabled="false" pixelhittest="true" preload="true" visible="false" alpha="0.0" />
<hotspot name="hot_1" style="cubeface" url="panos/night.tiles/pano_l.jpg" ath="-90" atv="0" zorder="2" />
<hotspot name="hot_2" style="cubeface" url="panos/night.tiles/pano_f.jpg" ath="0" atv="0" zorder="2" />
<hotspot name="hot_3" style="cubeface" url="panos/night.tiles/pano_r.jpg" ath="+90" atv="0" zorder="2" />
<hotspot name="hot_4" style="cubeface" url="panos/night.tiles/pano_b.jpg" ath="+180" atv="0" zorder="2" />
<hotspot name="hot_5" style="cubeface" url="panos/night.tiles/pano_u.jpg" ath="0" atv="-90" zorder="2" />
<hotspot name="hot_6" style="cubeface" url="panos/night.tiles/pano_d.jpg" ath="0" atv="+90" zorder="2" />
</scene>
</krpano>
Display More