I'm starting a pano with a view.hlookat of 0.
krpano returns returns positive or negative values for view.hlookat depending in which direction I start to turn my view.
BUT if I use adjusthlookat (for the reasons it was created for) the player returns only positive values, which will cause an unwanted behaviour if one uses these values to determine the absolute "distance" from view.hlookat="0"
To be more consistent adjusthlookat should deliver values from 0 to 180 and (-179) to (-1) instead of values from 0-360.
Here you can see what happens:
Just using view.hlookat
<krpano>
<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16" />
<view hlookat="0" vlookat="0" fov="105" />
<events onviewchanged="
sub(variable,0,get(view.hlookat));
set(hotspot[spot1].ox,get(variable));" />
<hotspot name="spot1"
url="image1.jpg"
zorder="1"
ath="0"
atv="0"
scale="1"
distorted="true"
zoom="true"
/>
</krpano>
Display More
Which would be fine if one wouldn't turn more then 360 degrees. But of course we want the image to be in the same place no matter how often we turn around.
So this is why I would use adjusthlookat
<events onviewchanged="
adjusthlookat(view.hlookat);
sub(variable,0,get(view.hlookat));
set(hotspot[spot1].ox,get(variable));" />
Which is ok as long as you turn counterclockwise, but as soon as you move to the opposite ...
... well, here is where the HELP part starts
How can I create a workaround or how could the rather simple code above be modified to get the wanted result?
Just from a logical aspect I see more then one solutions, but to put these into a working code is way above my possibilities.
So if you don't mind, please give me some hints.
Thank you
Jürgen