same atv ath value,hotspot has shifted

  • I used to dynamically create hotspot,use KRPANO drag hotspot examples code to save hotspot atv and atv value,using the same ath atv value create hotspot,hotspot has big sheifted.

    Thanks for the help.

  • I used to dynamically create hotspot,use KRPANO drag hotspot examples code to save hotspot atv and atv value,using the same ath atv value create hotspot,hotspot has big sheifted.

    Thanks for the help.

    To little information. Try to give a link or examples.


  • /*
    Get hotspot ath, atv value
    */

    <hotspot name="dragmessage" keep="true" devices="html5" width="168" height="32"
    url="%SWFPATH%/plugins/message.js?v2" renderer="css3d" border="false" backgroundalpha="0" bgalpha="0" ondown="draghotspot();"
    ath="0.0" atv="0.0" visible="false" zoom="false" mode="drag" distorted="false" edge="leftbottom"
    />

    <action name="draghotspot">
    spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
    sub(drag_adjustx, mouse.stagex, hotspotcenterx);
    sub(drag_adjusty, mouse.stagey, hotspotcentery);
    asyncloop(pressed,
    sub(dx, mouse.stagex, drag_adjustx);
    sub(dy, mouse.stagey, drag_adjusty);
    screentosphere(dx, dy, ath, atv);
    set_hotspot_pos();
    );
    </action>

    <action name="set_hotspot_pos"><![CDATA[
    copy(print_ath, ath);
    copy(print_atv, atv);
    roundval(print_ath, 3);
    roundval(print_atv, 3);
    copy(layer[dragdb].ath,print_ath);
    copy(layer[dragdb].atv,print_atv);
    ]]>
    </action>

    /*
    dynamically create a hotspot
    */
    <action name="addmessage">
    addhotspot(%1);
    set(hotspot[%1].name,%1);
    set(hotspot[%1].keep,"false");
    set(hotspot[%1].devices,"html5");
    set(hotspot[%1].width,"128");
    set(hotspot[%1].height,"32");
    set(hotspot[%1].url,"%SWFPATH%/plugins/lemessage.js?v1");
    set(hotspot[%1].renderer,"css3d");
    set(hotspot[%1].border,"false");
    set(hotspot[%1].backgroundalpha,"0");
    set(hotspot[%1].bgalpha,"0");
    set(hotspot[%1].ath,%2);
    set(hotspot[%1].atv,%3);
    set(hotspot[%1].visible,"true");
    set(hotspot[%1].zoom,"false");
    set(hotspot[%1].edge,"leftbottom");
    set(hotspot[%1].distorted,"false");

    </action>



    use the draghotspot function get atv,ath value;
    use the addmessage function dynamically create a hotspot, but after adding, the hotspot position has a big shift, how is this going on.


    when rotating up and down after the zoom view, hotspot location will be shifted,where I do wrong, how to fixed hotspot?
    thanks for your help.

    Edited once, last by localoca (July 10, 2016 at 5:43 PM).

  • Have you tried having a hard coded hotspot with the same values in your tour file next to the dynamic one? See if it acts the same way?

    Could it also be a depth thing? Don't think so.. but perhaps...

  • Different FOV, drag the hotspot get the same position ath atv values are not the same, dynamically added depth hotspot are not the same, I ask how to calculate depth hotspot, thank you for your help.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!