Sie sind nicht angemeldet.

1

Dienstag, 15. November 2011, 18:47

Next - Previous scene

Hi,
Before using krpano I worked with TourWeaver to make virtual tours, the default actions were easy and I could customize a buttoms skin.

I wonder if i can make buttoms to go forward and back through the panos in a VT.(next scene, previous scene)
If so how can I do it???
I mean to load panos in the order they are
Please help

2

Dienstag, 15. November 2011, 19:04

Hi,

Klaus made an automated solution for this ;-)

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
<action name="prevscene">
	if(%1 != findnext, sub(i,scene.count,1));
	txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
	if(scenexml == xml.content,
   	dec(i);
   	if(i LT 0, sub(i,scene.count,1));
   	loadscene(get(scene[%i].name), null, MERGE, BLEND(1));
  	,
   	dec(i);
   	if(i GE 0, prevscene(findnext));
  	);
</action>

<action name="nextscene">
	if(%1 != findnext, set(i,0));
	txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
	if(scenexml == xml.content,
   	inc(i);
   	if(i == scene.count, set(i,0));
   	loadscene(get(scene[%i].name), null, MERGE, BLEND(1));
  	,
   	inc(i);
   	if(i LT scene.count, nextscene(findnext));
  	);
</action>


You just need to make a plugin with onclick="action(prevscene);" and one with onclick="action(nextscene);" to call the actions...

Regards
Michael

3

Mittwoch, 16. November 2011, 01:27

hi!
one more version *rolleyes*


<action name="nextscene">
add(nextsceneindex, get(scene[get(xml.scene)].index),1);
if(nextsceneindex LT scene.count, loadscene(get(scene[get(nextsceneindex)].name), null, MERGE, BLEND(0.7)); );
</action>

<action name="prevscene">
sub(prevsceneindex, get(scene[get(xml.scene)].index),1);
if(prevsceneindex GT -1, loadscene(get(scene[get(nextsceneindex)].name), null, MERGE, BLEND(0.7)); );
</action>

Using: onclick="nextscene()" or onclcik="prevscene();"

Regards
Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

4

Mittwoch, 16. November 2011, 17:25

I really thank you you both! *thumbsup*
That was helpful

Now... is there any way to display scene's names as they change... *huh*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »manigordo« (16. November 2011, 18:11)


5

Dienstag, 31. Januar 2023, 04:55

loadscene

I want to move the camera on a button and when I use onclick="loadscene(scene_7)" the panorama changes to the given one but the camera moves to zero coordinates, but if I use onclick="loadscene(scene_7,null,KEEP3D,BLEND(1) );" the panorama also changes, but the camera freezes in the previous position

7

Dienstag, 31. Januar 2023, 13:58

" move the camera on a button " ?
you mean look at a button ?
https://krpano.com/docu/actions/#lookto
No, I mean moving by x y z, for example the scene is at x=100 y=200 z=50 and I have a problem that when I write "loadscene" command, all my coordinates = 0.