Greetings KRPano community.
I am working on a proof of concept and I have run into a wall.
I have a spherical image that I have loaded into a pano and I used a fancy function I found on this board named calc_pos_from_hfov_yaw_pitch_roll to add a hotspot to that pano. Works great!
Then I try to make the hotspot clickable and nothing happens. I have tried to create actions in my xml as well as calling external javascript functions and nothing seems to fire.
Any help would be appreciated!
HTML PAGE
<html>
<script src="pano.js"></script>
<div id="pano" style="width:100%;height:100%;">
<noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
<script>
embedpano({swf:"pano.swf", xml:"pano.xml", target:"pano", html5:"auto", passQueryParameters:true});
</script>
</div>
<script type="text/javascript">
function hotspotClicked() {
window.alert("hotspot pushed.");
}
</script>
</body>
</html>
XML PAGE
<krpano>
<image>
<sphere url="Pano_14982.jpg" />
</image>
<view hlookat="90" vlookat="15" fov="100" />
<hotspot name="stache"
url="mustache.png"
distorted="true"
onloaded="calc_pos_from_hfov_yaw_pitch_roll(10, 180, 0, 0)"
enabled="false"
alpha="1.0"
onclick="clicker_hotspot();"
/>
<action name="clicker_hotspot">
openurl('http://krpano.com',_self);
</action>
<action name="calc_pos_from_hfov_yaw_pitch_roll">
div(hfov,%1,57.295779);
div(yaw,%2,-57.295779);
div(pitch,%3,57.295779);
div(roll,%4,-57.295779);
mul(hfov,0.5);
Math.tan(hfov);
mul(width,hfov,1000);
set(height,'prop');
Math.cos(ch,yaw);
Math.sin(sh,yaw);
Math.cos(ca,pitch);
Math.sin(sa,pitch);
Math.cos(cb,roll);
Math.sin(sb,roll);
mul(m0,ca,ch);
mul(tmp,cb,sa);
mul(tmp,ch);
mul(tmp2,sb,sh);
add(m3,tmp,tmp2);
mul(m4,cb,ca);
mul(tmp,cb,sa);
mul(tmp,sh);
mul(tmp2,sb,ch);
sub(m5n,tmp,tmp2);
mul(m5n,-1);
mul(tmp,sb,sa);
mul(tmp,ch);
mul(tmp2,cb,sh);
sub(m6n,tmp,tmp2);
mul(m6n,-1);
Math.atan2(yaw,m6n,m0);
Math.atan2(roll,m5n,m4);
Math.asin(pitch,m3);
mul(ath,yaw,57.295779);
mul(atv,pitch,57.295779);
mul(rotate,roll,57.295779);
</action>
</krpano>
Thanks everyone!
Stefan