Sie sind nicht angemeldet.

1

Mittwoch, 21. März 2018, 19:16

HotSpot Scene Loop

Hello,

I have 2 hotspots in a bedroom, one goes to a kitchen and one that goes to a Bathroom. Below is the 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
44
<scene name="scene_Bedroom" title="Bedroom" onstart="" thumburl="panos/Bedroom.tiles/thumb.jpg" lat="" lng="" heading="">

		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/Bedroom.tiles/preview.jpg" />

		<image>
			<cube url="panos/Bedroom.tiles/pano_%s.jpg" />

			<cube url="panos/Bedroom.tiles/mobile/pano_%s.jpg" devices="mobile" />
		</image>

		<!-- place your scene hotspots here -->
		
		<hotspot name="spot1" style="spot1"
     	url.normal="kitchen.png" 
     	distorted="true"
     	onloaded="calc_pos_from_hfov_yaw_pitch_roll(150, 0, 0, 0);"/>
		 
		 
		 <hotspot name="spot3" style="spot3"
     	url.normal="bathroom.png" 
     	distorted="true"
     	onloaded="calc_pos_from_hfov_yaw_pitch_roll(150, 90, 0, 0);"/>
		 
	
<!-- spots -->	 

	<style name="spot1" ath="-150.7" atv="-20.5" edge="bottom" distorted="true" depth="3000" url="target.png" onloaded="do_crop_animation(128,128, 60);" scale="1" onover="tween(alpha,0.25,0.2);" onout="tween(alpha,1);" onclick="loadpano_no(2);" />
	
		<action name="loadpano_no">
		indexoftxt(contains_stereo, get(scene[get(xml.scene)].name), 'stereo');
		loadscene(calc(contains_stereo GT 0 ? 'scene_pano1_stereo' : 'scene_Kitchen'), null, KEEPVIEW|KEEPMOVING|NOPREVIEW, BLEND(0.5));
	</action>
	
	<style name="spot3" ath="-150.7" atv="-20.5" edge="bottom" distorted="true" depth="3000" url="target.png" onloaded="do_crop_animation(128,128, 60);" scale="1" onover="tween(alpha,0.25,0.2);" onout="tween(alpha,1);" onclick="loadpano_no(2);" />
	
		<action name="loadpano_no">
		indexoftxt(contains_stereo, get(scene[get(xml.scene)].name), 'stereo');
		loadscene(calc(contains_stereo GT 0 ? 'scene_pano1_stereo' : 'scene_Bathroom'), null, KEEPVIEW|KEEPMOVING|NOPREVIEW, BLEND(0.5));
	</action>
	
	
	</scene>



For some reason both go back to the same bathroom scene, instead of each respective scene.

Any thoughts on on what went wrong?

Thanks,
J

2

Donnerstag, 22. März 2018, 09:02

Hi,

you're redefining the 'loadpano_no' action.

When defining something again (like in your code), the new definition will overwrite the previous one.

As both actions are almost doing that say - why not using just one action and passing that thing that are different as arguments?

Best regards,
Klaus

3

Donnerstag, 22. März 2018, 16:43

Hi,

you're redefining the 'loadpano_no' action.

When defining something again (like in your code), the new definition will overwrite the previous one.

As both actions are almost doing that say - why not using just one action and passing that thing that are different as arguments?

Best regards,
Klaus
Hi Klaus,

Yes, after staring at it for awhile, its basically the same thing. I added a different argument instead of adding 2 'Loadpano_no', I added just 'loadscene' to the bathroom hotspot and fixed everything.

Jacques