Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
<action name="hid_show_hs" scope="local" args="stat" > for(set(i, 0), i LT hotspot.count, inc(i), copy(hs, hotspot[get(i)]); if(hs.name == 'infohs', copy(hstotween, hotspot[get(i)]); trace(hstotween.name); tween(hstotween.alpha, get(stat)); ); ); </action> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<action name="hid_show_hs" scope="local" args="stat" > for(set(i, 0), i LT hotspot.count, inc(i), copy(hs, hotspot[get(i)]); if(hs.name == 'infohs', trace(hs.name); tween(hotspot[get(i)].alpha, get(stat)); ); ); </action> |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »kme« (23. März 2023, 12:17)
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<layer name="test1" type="text" align="top" x="-30" html="on infohs" onclick="hid_show_hs(1)"/> <layer name="test2" type="text" align="top" x="30" html="off infohs" onclick="hid_show_hs(0)"/> <hotspot name="infohs" type="image" url="gallery.png" /> <hotspot name="hsp_1" type="image" url="VT.png" ath="-30" /> <action name="hid_show_hs" scope="local" args="stat"> forall(hotspot,h, if(h.name == 'infohs', trace(h.name); callwith(h, tween(alpha, *stat)); ); ); </action> |
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
Zitat
I ususally use San7 approach for looping through hotspts, but Tuur, your code looks so much clearner!
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
for(set(i,0),i LT hotspot.count, inc(i), if(hotspot[get(i)].tag == 'labrador', Helper(get(hotspot[get(i)].name)); ); ); <action name="Helper"> tween(hotspot[%1].volume, 9); </action> |
: https://pame.virtualtuur.com
Zitat
I ususally use San7 approach for looping through hotspts, but Tuur, your code looks so much clearner!
yes but since the beginning of times doing a tween or so like that on a hotspot doesn't work in a for loop.
My code is just the same but the new syntax is used.
The callwith 'trick' worked already since it was available.
We used to do, because of this, for example:
![]()
Quellcode
1 2 3 4 5 6 7 8 9 for(set(i,0),i LT hotspot.count, inc(i), if(hotspot[get(i)].tag == 'labrador', Helper(get(hotspot[get(i)].name)); ); ); <action name="Helper"> tween(hotspot[%1].volume, 9); </action>
Tuur![]()
|
|
Quellcode |
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 30 31 |
<action name="skin_keydown_event"> if( keycode === 80, set(layer[text-pos].visible, true); pos_update(); ); </action> <events name="pos_update" keep="true" onviewchange="pos_update();" /> <action name="pos_update" scope="localonly"> set(global.layer[text-ath].text, calc(roundval(global.view.hlookat, 2))); set(global.layer[text-atv].text, calc(roundval(global.view.vlookat, 2))); set(global.layer[text-fov].text, calc(roundval(global.view.fov, 2))); </action> <style name="text-position-bold" type="text" keep="true" align="rightbottom" padding="7" bgcolor="0xffffff" css="color: #003064; font-family: Arial, sans-serif; font-size: 16px; font-weight: bold;" /> <style name="text-position" type="text" keep="true" align="rightbottom" padding="7" bgcolor="0xffffff" css="color: #003064; font-family: Arial, sans-serif; font-size: 16px;" /> <layer name="text-pos" type="container" keep="true" align="rightbottom" x="30" y="160" visible="false"> <layer name="text-ath" style="text-position-bold" x="48" y="80" text="0" /> <layer name="text-atv" style="text-position-bold" x="48" y="40" text="0" /> <layer name="text-fov" style="text-position-bold" x="48" y="0" text="0" /> <layer name="text-ath-label" style="text-position" x="0" y="80" text="ATH" /> <layer name="text-atv-label" style="text-position" x="0" y="40" text="ATV" /> <layer name="text-fov-label" style="text-position" x="0" y="0" text="FOV" /> </layer> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<action name="pos_update" scope="localonly"> if (get(global.layer[text-pos].visible) == "true", set(global.layer[text-ath].text, calc(roundval(global.view.hlookat, 2))); set(global.layer[text-atv].text, calc(roundval(global.view.vlookat, 2))); set(global.layer[text-fov].text, calc(roundval(global.view.fov, 2))); ); </action> |
Hi, most likely when "visible" is disabled, the layer is ignored. Manage "alpha" instead of "visible"
I noticed, that the text of invisible layers is not reliably updated, even after they switch to being visible. Please see this test case:
https://36o.de/test/krpano1.21-text-update/
After loading the tour, move the panorama at least a little bit, then press the character "p" on your keyboard. This will show the current numbers for hlookat, vlookat and fov in the bottom right corner of the tour. However, most of the time the number for ath (hlookat) will not be displayed. Sometimes, two or all three numbers are not displayed. When you start moving the panorama again, the numbers are usually displayed after a few seconds.
Workaround:
![]()
Quellcode
1 2 3 4 5 6 7 8 9 <action name="pos_update" scope="localonly"> if (get(global.layer[text-pos].visible) == "true", set(global.layer[text-ath].text, calc(roundval(global.view.hlookat, 2))); set(global.layer[text-atv].text, calc(roundval(global.view.vlookat, 2))); set(global.layer[text-fov].text, calc(roundval(global.view.fov, 2))); ); </action>
Hi, most likely when "visible" is disabled, the layer is ignored. Manage "alpha" instead of "visible"
set(layer[text-pos].alpha, 1);
<layer name="text-pos" ... visible="true" alpha="0"
I have the feeling that doing too many things in the onviewchange() event is not optimal.
(Escpecially in the beginning when not everything is initialized yet)
|
|
Quellcode |
1 2 3 4 5 6 7 |
<action name="pos_update" scope="local"> if(layer[text-pos].visible, roundval(layer[text-ath].text, view.hlookat, 2); roundval(layer[text-atv].text, view.vlookat, 2); roundval(layer[text-fov].text, view.fov, 2); ); </action> |
I noticed, that the text of invisible layers is not reliably updated, even after they switch to being visible. Please see this test case:
https://36o.de/test/krpano1.21-text-update/
Thanks for the example!I would expect changes to apply without a delay after setting the layer to visible.
Sorry, but I don't understand what you mean...I have a question about the display of obj.
Is the error often on smart phones due to the size of the obj, etc?
When an error is returned on a smart phone, is it because it is a preview version that it shows as a demo version?
That's not directly a bug, that's the behavior defined the vtourskin.xml for 3d-transitions (see the skin_scene3dtransition action).Is it a bug if two hotspots in adjacent scenes, when placed too closely, do not work ideally or even poorly, resulting in vertical switching effect rather than horizontal effect? set3dtransition Is it a parameter setting issue?
|
|
Quellcode |
1 |
if(v GT -50 AND v LT +50 AND caller.depth GT 120, set(v,0)); |
|
|
Quellcode |
1 |
set(v,0); |
klaus.krpano-sanHi, that error would only appear when the browser doesn't offer WebGL support (for some reason).