Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<events name="bla" keep="true" onviewchange="3d_hotspots_in_range();" /> <action name="3d_hotspots_in_range" protect="true"> adjusthlookat(0); calc(vty1, view.tz); calc(vtx1, view.tx); for(set(i,0), i LT hotspot.count, inc(i), calc(vty2, hotspot[get(i)].tz); calc(vtx2, hotspot[get(i)].tx); calc(phh1, (vty2 - vty1) / (vtx2 - vtx1)); Math.atan(_rads, phh1); calc(_degs, _rads * (180 / Math.PI)); if(view.hlookat GE 0, calc(hotspot[get(i)].pseudoath, 90 - _degs); , calc(hotspot[get(i)].pseudoath, -90 - _degs); ); getlooktodistance(d, hotspot[get(i)].pseudoath, 0); if(d LT 10, set(hotspot[get(i)].bgcolor, 0x00ff00); , set(hotspot[get(i)].bgcolor, 0xff0000); ); ); </action> |
: https://pame.virtualtuur.com|
|
Source code |
1 2 3 4 5 6 7 |
<action name="get_3d_distance" scope="local"> calc(x,caller.tx - view.tx); calc(y,caller.ty - view.ty); calc(z,caller.tz - view.tz); calc(d,sqrt(x*x + y*y + z*z)); ... </action> |
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comLocation: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
Quoted
By the way your example seems to be false, if you pan around then d value is changing.
: https://pame.virtualtuur.comThis post has been edited 1 times, last edit by "Tuur" (Mar 20th 2021, 5:27pm)