You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

manigordo

Trainee

  • "manigordo" started this thread

Posts: 75

Location: Costa Rica

  • Send private message

1

Tuesday, November 15th 2011, 6:47pm

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

MichaelN

Beginner

Posts: 26

Location: Bayern

  • Send private message

2

Tuesday, November 15th 2011, 7:04pm

Hi,

Klaus made an automated solution for this ;-)

Source code

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

mindlessboss

Professional

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

3

Wednesday, November 16th 2011, 1:27am

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

manigordo

Trainee

  • "manigordo" started this thread

Posts: 75

Location: Costa Rica

  • Send private message

4

Wednesday, November 16th 2011, 5:25pm

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

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

This post has been edited 1 times, last edit by "manigordo" (Nov 16th 2011, 6:11pm)


5

Tuesday, January 31st 2023, 4:55am

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

6

Tuesday, January 31st 2023, 9:52am

" move the camera on a button " ?
you mean look at a button ?
https://krpano.com/docu/actions/#lookto

7

Tuesday, January 31st 2023, 1:58pm

" 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.