You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, July 10th 2016, 9:25am

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.

Timescale

Trainee

Posts: 120

Location: Netherlands

Occupation: Archaeologist, Timescale R&D

  • Send private message

2

Sunday, July 10th 2016, 3:49pm

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.

3

Sunday, July 10th 2016, 5:14pm


/*
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.

This post has been edited 1 times, last edit by "localoca" (Jul 10th 2016, 5:43pm)


Timescale

Trainee

Posts: 120

Location: Netherlands

Occupation: Archaeologist, Timescale R&D

  • Send private message

4

Sunday, July 10th 2016, 8:30pm

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...

5

Monday, July 11th 2016, 7:19am

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.

6

Monday, August 8th 2016, 10:46am

set the hotspot edge="bottom"