.|
|
Quellcode |
1 |
ath = (x / imagewidth - 0.5) * 360 |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Joel« (26. Mai 2017, 09:35)
.|
|
Quellcode |
1 2 3 4 5 6 7 |
<action name="calc_spherical_offset">
Math.atan2(a, %1, 500);
calc(%2, a * 180.0 / Math.PI);
</action>
<hotspot name="h1" url="..." distorted="true" ath="0" width="200" height="100" />
<hotspot name="h2" url="..." distorted="true" ath="0" width="200" height="100" onloaded="calc_spherical_offset(+200,h); add(ath,h);" />
|
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<action name="calc_spherical_offset">
Math.atan2(a, %1, 500);
calc(%2, a * 180.0 / Math.PI);
</action>
<hotspot name="h1" style="bgthumbnails" ath="0" />
<hotspot name="h2" style="bgthumbnails" ath="0" onloaded="calc_spherical_offset(+200,hotspot[get(name)].ath);" />
<hotspot name="h3" style="bgthumbnails" ath="0" onloaded="calc_spherical_offset(+400,hotspot[get(name)].ath);" />
<hotspot name="h4" style="bgthumbnails" ath="0" onloaded="calc_spherical_offset(+600,hotspot[get(name)].ath);" />
|
|
|
Quellcode |
1 2 3 4 |
<hotspot name="h1" style="bgthumbnails" ath="0" /> <hotspot name="h2" style="bgthumbnails" ath="0" onloaded="calc_spherical_offset(+200,h); calc(hotspot[get(name)].ath,h*1);" /> <hotspot name="h3" style="bgthumbnails" ath="0" onloaded="calc_spherical_offset(+200,h); calc(hotspot[get(name)].ath,h*2);" /> <hotspot name="h4" style="bgthumbnails" ath="0" onloaded="calc_spherical_offset(+200,h); calc(hotspot[get(name)].ath,h*3);" /> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<action name="calc_spherical_offset">
Math.atan2(a, %1, 500);
calc(%2, a * 180.0 / Math.PI);
</action>
<action name="arrange_hotspots">
callwhen(hotspot[%2].arranged == true,
calc_spherical_offset(calc(hotspot[%1].width/2),h1);
calc_spherical_offset(calc(hotspot[%2].width/2),h2);
calc(hotspot[%1].ath, hotspot[%2].ath + h1 + h2);
set(hotspot[%1].arranged, true);
);
</action>
<hotspot name="h1" url="..." distorted="true" ath="0" ... arranged="false" onloaded="set(arranged,true);" />
<hotspot name="h2" url="..." distorted="true" ... arranged="false" onloaded="arrange_hotspots(h2,h1);" />
<hotspot name="h3" url="..." distorted="true" ... arranged="false" onloaded="arrange_hotspots(h3,h2);" />
<hotspot name="h4" url="..." distorted="true" ... arranged="false" onloaded="arrange_hotspots(h4,h3);" />
|
). This would definitely work (because this time I've tested the code before posting).