Sie sind nicht angemeldet.

1

Samstag, 19. Oktober 2019, 16:24

Compass layer

HI,

I have a compass copied from krpano example with minor mods:


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!-- compass background layer -->
<layer name="compass1" 
url="compass_bg.png" align="rightbottom" x="10" y="10" keep="true" 
children="false" scalechildren="true" destscale="1.0" 
onclick="switch(destscale,1.0,0.5);tween(scale,get(destscale));">

<!-- compass plate -->
<layer name="compass1_plate" url="buscard.png" align="center" zorder="1" /> 

<!-- compass pointer -->
<layer name="compass1_pointer" url="agocor.png" align="center" zorder="2" />

	</layer>
	
	<!-- view changing event -->
	<events name="compass_events" onviewchange="compass_update_rotate();" />

	<!-- update the rotation values -->
	
<action name="compass_update_rotate">
set(global_heading, 180);
calc(layer[compass1_pointer].rotate, view.hlookat - global_heading);
</action>



The compass pointer does not rotate on viewchange.

Am I missing something?

Thank you for any help.

Giuseppe

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Samstag, 19. Oktober 2019, 23:01

<events name="compass_events" keep="true" onviewchange="compass_update_rotate();" />


Check what happens if you add the green code.


Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Sonntag, 20. Oktober 2019, 20:13

Piotr,
It works: thank you very much!
Best regards,

Giuseppe