Sie sind nicht angemeldet.

1

Sonntag, 20. September 2020, 18:50

Noobie Question: Blending Cube Example and Scenes

Hello,

I just started playing around with the Blending Cubes scene example, and wanted to add it to a <Scene></Scene> setup so I can have 2 pano scenes.

Figured this would simple, sorta works, but when clicking the thumbnail, doesn't load the scenes, all though when the slider is pressed, pops on the view. So maybe something with the slider?

Any help appreciated.

My code is below

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
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
<scene name="Slider1"  thumburl="panos/Slider1.tiles/thumb.jpg">
	<view hlookat="110" vlookat="40" fovtype="MFOV" fov="130" fovmin="60" fovmax="160" />


	<layer name="slider_bg" url="slider_background.png" align="bottom" x="0" y="30" handcursor="false" width.mobile="220" />
	
	<layer name="slider_grip" url="slider_grip.png" align="left" edge="center" parent="slider_bg" x="0"
	       ondown="copy(drag_currentx, x); copy(drag_stagex, mouse.stagex);
	               asyncloop(pressed,
	                 calc(newx, drag_currentx + (mouse.stagex - drag_stagex)); 
	                 clamp(newx, 0, get(layer[slider_bg].pixelwidth));
	                 copy(x, newx);
	                 setblend(calc(newx / layer[slider_bg].pixelwidth));
	               );"
			/>


	<style name="cubeface" distorted="true" width="1000" height="1000" enabled="false" alpha="0.0" />


	<hotspot name="pano1_f" style="cubeface" url="pano1_f.jpg" ath="0" atv="0" />
	<hotspot name="pano1_l" style="cubeface" url="pano1_l.jpg" ath="-90" atv="0" />
	<hotspot name="pano1_r" style="cubeface" url="pano1_r.jpg" ath="+90" atv="0" />
	<hotspot name="pano1_u" style="cubeface" url="pano1_u.jpg" ath="0" atv="-90" />
	<hotspot name="pano1_d" style="cubeface" url="pano1_d.jpg" ath="0" atv="+90" />
	<hotspot name="pano1_b" style="cubeface" url="pano1_b.jpg" ath="+180" atv="0" />
	
	<hotspot name="pano2_f" style="cubeface" url="pano2_f.jpg" ath="0" atv="0" />
	<hotspot name="pano2_l" style="cubeface" url="pano2_l.jpg" ath="-90" atv="0" />
	<hotspot name="pano2_r" style="cubeface" url="pano2_r.jpg" ath="+90" atv="0" />
	<hotspot name="pano2_u" style="cubeface" url="pano2_u.jpg" ath="0" atv="-90" />
	<hotspot name="pano2_d" style="cubeface" url="pano2_d.jpg" ath="0" atv="+90" />
	<hotspot name="pano2_b" style="cubeface" url="pano2_b.jpg" ath="+180" atv="0" />
	
	<action name="setblend">
		set(blend1, %1);
		sub(blend2, 1.0, %1);
		copy(hotspot[pano1_f].alpha, blend1);
		copy(hotspot[pano1_l].alpha, blend1);
		copy(hotspot[pano1_r].alpha, blend1);
		copy(hotspot[pano1_b].alpha, blend1);
		copy(hotspot[pano1_u].alpha, blend1);
		copy(hotspot[pano1_d].alpha, blend1);
		copy(hotspot[pano2_f].alpha, blend2);
		copy(hotspot[pano2_l].alpha, blend2);
		copy(hotspot[pano2_r].alpha, blend2);
		copy(hotspot[pano2_b].alpha, blend2);
		copy(hotspot[pano2_u].alpha, blend2);
		copy(hotspot[pano2_d].alpha, blend2);
	</action>
	
	<action name="start" autorun="onstart">
		setblend(0);
	</action>
	</scene>
	
	
	
	<scene name="Slider2"  thumburl="panos/Slider2.tiles/thumb.jpg" >
		
	<view hlookat="110" vlookat="40" fovtype="MFOV" fov="130" fovmin="60" fovmax="160" />


	<layer name="slider_bg" url="slider_background.png" align="bottom" x="0" y="30" handcursor="false" width.mobile="220" />
	
	<layer name="slider_grip" url="slider_grip.png" align="left" edge="center" parent="slider_bg" x="0"
	       ondown="copy(drag_currentx, x); copy(drag_stagex, mouse.stagex);
	               asyncloop(pressed,
	                 calc(newx, drag_currentx + (mouse.stagex - drag_stagex)); 
	                 clamp(newx, 0, get(layer[slider_bg].pixelwidth));
	                 copy(x, newx);
	                 setblend(calc(newx / layer[slider_bg].pixelwidth));
	               );"
			/>


	<style name="cubeface" distorted="true" width="1000" height="1000" enabled="false" alpha="0.0" />


	<hotspot name="pano1_f" style="cubeface" url="pano1_f.jpg" ath="0" atv="0" />
	<hotspot name="pano1_l" style="cubeface" url="pano1_l.jpg" ath="-90" atv="0" />
	<hotspot name="pano1_r" style="cubeface" url="pano1_r.jpg" ath="+90" atv="0" />
	<hotspot name="pano1_u" style="cubeface" url="pano1_u.jpg" ath="0" atv="-90" />
	<hotspot name="pano1_d" style="cubeface" url="pano1_d.jpg" ath="0" atv="+90" />
	<hotspot name="pano1_b" style="cubeface" url="pano1_b.jpg" ath="+180" atv="0" />
	
	<hotspot name="pano2_f" style="cubeface" url="pano2_f.jpg" ath="0" atv="0" />
	<hotspot name="pano2_l" style="cubeface" url="pano2_l.jpg" ath="-90" atv="0" />
	<hotspot name="pano2_r" style="cubeface" url="pano2_r.jpg" ath="+90" atv="0" />
	<hotspot name="pano2_u" style="cubeface" url="pano2_u.jpg" ath="0" atv="-90" />
	<hotspot name="pano2_d" style="cubeface" url="pano2_d.jpg" ath="0" atv="+90" />
	<hotspot name="pano2_b" style="cubeface" url="pano2_b.jpg" ath="+180" atv="0" />
	
	<action name="setblend">
		set(blend1, %1);
		sub(blend2, 1.0, %1);
		copy(hotspot[pano1_f].alpha, blend1);
		copy(hotspot[pano1_l].alpha, blend1);
		copy(hotspot[pano1_r].alpha, blend1);
		copy(hotspot[pano1_b].alpha, blend1);
		copy(hotspot[pano1_u].alpha, blend1);
		copy(hotspot[pano1_d].alpha, blend1);
		copy(hotspot[pano2_f].alpha, blend2);
		copy(hotspot[pano2_l].alpha, blend2);
		copy(hotspot[pano2_r].alpha, blend2);
		copy(hotspot[pano2_b].alpha, blend2);
		copy(hotspot[pano2_u].alpha, blend2);
		copy(hotspot[pano2_d].alpha, blend2);
	</action>
	
	<action name="start" autorun="onstart">
		setblend(0);
	</action>
	</scene>