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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
<krpano>
<images number="4" dirname="." filename="Smog" />
<!--<images number="8" dirname="." filename="pano" />-->
<!-- the startup viewing settings -->
<view hlookat="0" vlookat="0" fovtype="HFOV" fov="100" fovmin="50" fovmax="150" />
<!-- autorotation -->
<autorotate enabled="false" waittime="3.0" />
<!--<autorotate enabled="true"
waittime="3.0"
speed="10.0"
horizon="0.0"
/>-->
<!-- title text-->
<layer name="title" url="%SWFPATH%/plugins/textfield.swf" align="top" width="90%" y="5%" html=" " background="false" css="text-align:center; font:Arial; font-size:20px; font-weight:bold; font-style:italic; color:#FFFFFF;" textshadow="2" enabled="false" />
<!-- the action/code starts here -->
<action name="start" autorun="onstart">
div(slicedegree,360,images.number);
for(set(k,1), k LE images.number, inc(k),
set(name_l, calc:images.dirname +""+images.filename + k + "_l.jpg");
set(name_f, calc:images.dirname +""+images.filename + k + "_f.jpg");
set(name_r, calc:images.dirname +""+images.filename + k + "_r.jpg");
set(name_b, calc:images.dirname +""+images.filename + k + "_b.jpg");
set(name_u, calc:images.dirname +""+images.filename + k + "_u.jpg");
set(name_d, calc:images.dirname +""+images.filename + k + "_d.jpg");
addcube(get(k),get(name_l),get(name_f),get(name_r),get(name_b),get(name_u),get(name_d));
mul(end,k,slicedegree);
sub(start,end,slicedegree);
set(end_a[a].item[get(k)].value, get(end));
set(start_a[a].item[get(k)].value, get(start));
);
<!-- trace(not all visible);
for(set(t,1),t LE images.number,inc(t),
cubevisible(get(t),true);
); -->
def(currpano,integer,3); <!-- set to "wrong" number so refresh will happen on first go -->
trace(only once);
</action>
<action name="addcube">
addface('face_%1_l', '%2', -90, 0);
addface('face_%1_f', '%3', 0, 0);
addface('face_%1_r', '%4', +90, 0);
addface('face_%1_b', '%5', +180, 0);
addface('face_%1_u', '%6', 0, -90);
addface('face_%1_d', '%7', 0, +90);
</action>
<action name="addface">
addhotspot('%1');
copy(hs, hotspot['%1']);
<!-- trying to force only face_1_x to have a high zorder and all the other ones low to prevent image cycling on loading but no luck-->
indexoftxt(ind,'%1','1');
if(ind != -1,
set(hs.zorder, 5);
,
set(hs.zorder,1);
);
set(hs.url, '%2');
set(hs.ath, %3);
set(hs.atv, %4);
set(hs.width, 1000);
set(hs.height, 1000);
set(hs.distorted, true);
set(hs.enabled, false);
set(hs.visible, true);
set(hs.alpha, 1.0);
</action>
<events name="switchcubes" onviewchange="switchcubes();"
/>
<action name="switchcubes">
add(pan, view.hlookat, 0.5);
mod(pan,360);
if(pan LT 0,
add(pan,360);
);
for(def(i,integer,1), i LE images.number, inc(i),
if(pan GE start_a[a].item[get(i)].value,
if (pan LT end_a[a].item[get(i)].value,
if(currpano != i,
trace(i);
<!--forloopalpha(get(i));-->
<!--forloopvisible(get(i));-->
forloopzorder(get(i));
set(currpano,get(i));
);
);
);
);
</action>
<action name="forloopalpha">
for(set(m,1), m LE images.number, inc(m),
if(m EQ %1,
setcubealpha(get(m),1);
,
setcubealpha(get(m),0);
);
);
</action>
<action name="forloopvisible">
<!--trace('active pano: ',%1);-->
for(set(m,1), m LE images.number, inc(m),
if(m EQ %1,
cubevisible(get(m),true);
,
cubevisible(get(m),false);
);
);
</action>
<action name="forloopzorder">
for(set(m,1), m LE images.number, inc(m),
if(m EQ %1,
setcubezorder(get(m),5);
,
setcubezorder(get(m),1);
);
);
</action>
<action name="setcubealpha">
set(hotspot[face_%1_l].alpha, %2);
set(hotspot[face_%1_f].alpha, %2);
set(hotspot[face_%1_r].alpha, %2);
set(hotspot[face_%1_b].alpha, %2);
set(hotspot[face_%1_u].alpha, %2);
set(hotspot[face_%1_d].alpha, %2);
</action>
<action name="cubevisible">
set(hotspot[face_%1_l].visible, %2);
set(hotspot[face_%1_f].visible, %2);
set(hotspot[face_%1_r].visible, %2);
set(hotspot[face_%1_b].visible, %2);
set(hotspot[face_%1_u].visible, %2);
set(hotspot[face_%1_d].visible, %2);
</action>
<action name="setcubezorder">
set(hotspot[face_%1_l].zorder, %2);
set(hotspot[face_%1_f].zorder, %2);
set(hotspot[face_%1_r].zorder, %2);
set(hotspot[face_%1_b].zorder, %2);
set(hotspot[face_%1_u].zorder, %2);
set(hotspot[face_%1_d].zorder, %2);
</action>
</krpano>
|