You are not logged in.

1

Wednesday, October 19th 2011, 9:51am

automatic scene loading after full rotation

Hi
I try to make tour with auto loading scenes. I find a solution :

Source code

1
2
3
4
5
6
<action name="scene_1_start">
			set(ath, get(view.hlookat));
			 inc(ath, 360);
			  lookto(get(ath),0, 90, 5);
			  loadscene(scene_next);
		</action>


but it don't work for me.

I have this before action :

Source code

1
2
<scene name="scene_1" title="1" onstart="scene_1_start();">
		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="95" fovmin="45" fovmax="120" />


and I think the problem is in it, but I can't fix it.

2

Thursday, October 20th 2011, 11:07am

try this. i hope that is what you want:

Source code

1
2
3
<action name="scene_1_start">
			tween(view.hlookat, 360, 20, linear, loadscene(scene_2); );		
</action>


your problem is, that there is no incremental rotation. you set the hlookat directly to 360. after this you try to load "scene_next". is "scene_next" correctly defined with the name of the scene to load?

I hope I could help

3

Thursday, October 20th 2011, 4:42pm

I don't understand how to set movement in scene.
when scene is load:

Source code

1
2
<scene name="scene_4" title="scene4" onstart="">
		<view hlookat="180" vlookat="0" fovtype="MFOV" fov="95" fovmin="45" fovmax="120" />

it start ok, but what when I want to start from another point ?
when I change hlookat to ex 90 I will have move before auto rotation start, why ?

here is my sample scene (every scene is analogous):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<scene name="scene_sypialnia" title="sypialnia" onstart="">
		<view hlookat="180" vlookat="0" fovtype="MFOV" fov="95" fovmin="45" fovmax="120" />

		<!-- include buttons template -->
		<include url="nav/nav.xml"/>
		
		<!-- include thumbnails template -->
		<include url="thumb/thumb.xml"/>
		
		<!-- include map -->
		<include url="map2.xml"/>
		
		<image>
			<left  url="pano/sypialnia/sypialnia_3.jpg" />
			<front url="pano/sypialnia/sypialnia_0.jpg" />
			<right url="pano/sypialnia/sypialnia_1.jpg" />
			<back  url="pano/sypialnia/sypialnia_2.jpg" />
			<up	url="pano/sypialnia/sypialnia_4.jpg" />
			<down  url="pano/sypialnia/sypialnia_5.jpg" />
		</image>

	</scene>


suggested solution from post before don't work for me.

4

Sunday, October 23rd 2011, 12:02pm

Should be very easy to solve using a variable and a add-routine.

- create a variable with the value of the current hlookat
set(dummy1,get(hlookat));

- add 360 to dummy1
add(dummy2,get(dummy1),360);

check with an event if current hlookat is equal to dummy2 and start an action to load the next scene.

Should work ;-)

Best regards
Nupsi

5

Sunday, October 23rd 2011, 5:10pm

thanks for replay. I am new in krpano and I have many problems, flash panorama player it very different :)
so everything should look like that ?:

Source code

1
2
3
4
5
6
set(dummy1,get(hlookat));
add(dummy2,get(dummy1),360);

<events name="nestScene" keep="false" 
			if (get(hlookat) == dummy2, loadscene(scene_2));
/>


this code don't work but I don't know why.
and it should be in a concrete scene ?

thanks for help and patience

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

6

Tuesday, October 25th 2011, 8:16pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<action name="autotour">
	lookto(360,0, , smooth(20,20,20), false, false, load_next_scene());
</action>
<action name="load_next_scene">
	<!-- get current scene index -->
	copy(index, scene[get(xml.scene)].index);
	<!-- increase for the next scene -->
	inc(index);
	
	<!-- make sure the index doesnt go beyond the amount of scenes. when it reaches the end, start over again -->
	if(index GT scene.count,
		set(index, 0);
	);
	
	<!-- load next scene -->
	loadscene(scene[get(index)].name);
</action>

<scene name="scene_1" onstart="autotour()">

</scene>


something like this would work.

remember, lookto has a parameter, shortestway. If set to false, it will take the long route. So if your hlookat = 0, and you set the lookto to 360, it will take the long way.

7

Friday, June 29th 2012, 12:47pm

Hi Zephyr,

I have tried below code but not able to call "load_next_scene()". Is there any other way to call action once 360 degree rotation is completed.

Source code

1
lookto(360,0, , smooth(20,20,20), false, false, load_next_scene());


Thanks
pratiks