Sie sind nicht angemeldet.

mds

Fortgeschrittener

  • »mds« ist der Autor dieses Themas

Beiträge: 152

Wohnort: Athens, GA

Beruf: Designer

  • Nachricht senden

1

Freitag, 30. März 2012, 21:16

Hotspot coding shortcut

I've got two panos, one hotspot in each linking to the other panorama. I like coding it so that the linked pano is looking at the previous panos hotspot when loaded. I use the following code:



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
32
33
34
35
36
37
38
39
40
41
42
43
<scene name="scene1">

          ....

          <hotspot 
               name="hs1"
               ath="39" atv="0"
               url="assets/hotspot.png"
               keep="false"
               onclick="loadhs1();"
          />
	    
          <action name="loadhs1">
               looktohotspot(get(name)); 
               loadscene(scene_set2, null, MERGE, BLEND(1));
               lookat(210,0,130);
               wait(blend);
          </action>

</scene>



<scene name="scene2">

          ....

          <hotspot 
               name="hs2"
               ath="210" atv="0"
               url="assets/hotspot.png"
               keep="false"
               onclick="loadhs2();"
          />
	    
          <action name="loadhs2">
               looktohotspot(get(name)); 
               loadscene(scene_set1, null, MERGE, BLEND(1));
               lookat(39,0,130);
               wait(blend);
          </action>

</scene>



What would be the best way to make "lookat(210,0,130);" dynamic?

eg.

<action name="loadhs1">
looktohotspot(get(name));
loadscene(scene_set2, null, MERGE, BLEND(1));
lookat( "get previous scene and hotspot.ath", 0, 130);
wait(blend);
</action>
Say "Hi!" on twitter

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Montag, 2. April 2012, 13:05

One way to it is to store the ath/atv of the hotspot

Quellcode

1
2
3
4
5
6
7
8
9
 <action name="loadhs1">
               looktohotspot(get(name)); 
              wait(blend);
              copy(prev_ath, ath);
               copy(prev_atv, atv);
               loadscene(scene_set2, null, MERGE, BLEND(1));
               lookat(get(prev_ath),get(prev_atv),130);
               wait(blend);
          </action>

3

Mittwoch, 4. April 2012, 16:01

Hi,

using the KEEPVIEW flag for the loadpano/loadscene call would be also a possibility,

best regards,
Klaus