Sie sind nicht angemeldet.

1

Montag, 26. August 2013, 14:20

Direct link to specific scene tutorial (url params)

Hi!
Customers often ask me about scenes direct link (url) in the tour.
Well, krpano has great feature pass url params to xml.
And here is small tutorial of how to use it.

First, you need to set passQueryParameters to true
example:
embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", passQueryParameters:true });
then you can use any variable names in url string
for example:
yourdomain.com/mytours/tour.htm?some_variable=value_of_variable&more_var=its_value
and so on
all this variables will be passed to xml and you can get it's values
like get(some_variable) or get(more_var)

So, what if we want to start specific scene from url?
then let's use start_scene for define which scene to start.
your url will be like this
yourdomain.com/mytours/tour.htm?start_scene=scene_name_or_index
and in xml
some start action

Quellcode

1
2
3
4
5
6
7
8
9
10
<krpano onstart="start();"
<action name="start">
	<!-- set default start scene if start_scene is not defined -->
	if(start_scene === null, set(start_scene,0); );
	loadscene(get(start_scene));
</action>

...

</krpano>



you can pass start view same way or any other variables to your tour xml.

Well, I hope you will find it usefull

Best wishes
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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Sudarchikov Andrey« (1. März 2014, 12:21)


2

Montag, 26. August 2013, 15:11

Great, a nice straightforward example. Appreciate the mini-tute. Care to add some challenging examples?
Thanks Andrey!
Tony

3

Montag, 26. August 2013, 19:25

Small working example!

how to use:
open tour.html
and add params to url, for example:
tour.html?start_scene=scene1
or
tour.html?start_scene=1


name and index of the scene can be used

start_fov, start_hlookat, start_vlookat also available in this example

for example:
tour.html?start_scene=2&start_fov=70&start_vlookat=20

Enjoy
Andrey *thumbup*





»Sudarchikov Andrey« hat folgende Datei angehängt:
  • paramsDemo.zip (178,17 kB - 534 mal heruntergeladen - zuletzt: Heute, 06:47)
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

Montag, 2. September 2013, 19:43

Well done!
It's working!

And can to be useful, thank you! *rolleyes*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Arsdezi« (4. September 2013, 05:13)


5

Sonntag, 20. April 2014, 17:01

Hi

i did try the exemple but is it possible the the url dinamicly display the full link every time you change panorama

if you click on scene 2 the url change to:
tour.html?start_scene=2&start_fov=70&start_vlookat=20

if you click on scene 1 url automaticly change to

tour.html?start_scene=1&start_fov=70&start_vlookat=20


Kind regards,

José

wilsan

Schüler

Beiträge: 66

Wohnort: Nederland

Beruf: Logistics Specialist – Planning & Logistics

  • Nachricht senden

6

Samstag, 3. Mai 2014, 18:39

Very useful example, very easy to use. *thumbup*
Its working fine,Thanks Andrey.

Masterwork done by Andrey. *thumbsup*

Stefan.L

Schüler

Beiträge: 102

Wohnort: Sweden

Beruf: Photography/ webdesign

  • Nachricht senden

7

Mittwoch, 22. Oktober 2014, 14:38

Very useful! Great!
Best regards - Stefan

8

Sonntag, 12. Juli 2015, 00:22

Hello

i followed your tutorial and found passQueryParameters set to ture already in my tour.html

and when i write the url in the address bar in my browser likethat it opens the next scene instead of the written number?! i don`t know what did i do wrong? :/

plus.. i actually when i started to read this thread i thought that it would be able to get the link updated from current scene i`m viewing.. i mean for example if i`m viewing scene no 007 and i clicked on share.. it shares this scene.. not the main tour link that opens from scene 001.. get me?

thanks in advance :)

9

Sonntag, 12. Juli 2015, 21:11

Scene name must starts from letter
004 - trying to load 4 index scene (0,1,2,3,4) 5-th actually
so it's correct behaviour
rename your scenes to string names like s004 or something


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

10

Freitag, 14. August 2015, 17:09

Thank you for this tip, is working as supposed to, now that we can access direct panos inside the virtual tour, i wonder do you know a way to share(on facebook) a specific pano within the virtual tour?

Edit:

I saw you already made this happen in another post, so thank you again :)

Thanks
Sebastian

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »sebastianm« (14. August 2015, 20:57)


11

Donnerstag, 15. November 2018, 19:57

Is it possible to get these vars when change current view?
Update the url when user is looking up an see something interesting and want to share the scene but with the current view?



Many thanks for your solution Andrey!

12

Sonntag, 18. November 2018, 22:18

Hi Andrey,

Thank you for sharing your example!
Since 1.19.pr3 there is 'deep linking' in krpano, which allows to start any scene of the tour.xml
https://krpano.com/forum/wbb/index.php?p…ews119vtourskin

It seems to do the same job as your code.
The <action name="skin_deeplinking_update_url_process" of the vtourskin.xml brings the syntax of the url. The <view> can be set by the url, too.
Pavel

13

Mittwoch, 21. November 2018, 22:17

Thx,

deeplinking was my solution.

But is it possible to change the path of the deeplinking?


http://192.168.178.22:666/?s=0&ansicht=lookat(112,56,140);


to

http://192.168.178.22:666/?s=0&hlookat=1…okat=56&fov=140


<action name="skin_deeplinking_update_url_process">
copy(adr, browser.location);
indexoftxt(qi, get(adr), '?');
if(qi GT 0, subtxt(adr, adr, 0, get(qi)));
copy(si, scene[get(xml.scene)].index);
copy(h, view.hlookat);
copy(v, view.vlookat);
copy(f, view.fov);
set(pp, calc(f LT 10 ? 6 : 0));
roundval(h, get(pp));
roundval(v, get(pp));
roundval(f, get(pp));
set(adr, calc(adr + '?s=' + si + '&amp;ansicht=lookat('+h+','+v+','+f+');'));
js( history.replaceState(null, document.title, get(adr)); );
</action>


Thanks for any help! *smile*

14

Montag, 26. November 2018, 22:50

Anjenehm,
If you use the default krpano tour.xml generated by the MAKE VTOUR (MULTIRES) droplet (ver. 1.19.pr16) you see the

Quellcode

1
2
3
4
5
6
	<!-- startup action - load the first scene -->
	<action name="startup" autorun="onstart">
		if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
		loadscene(get(startscene), null, MERGE);
		if(action[startactions].name !== null, startactions() );
	</action>

Then you can start any of your scenes by adding to the startlink yourdomain.tour.html?startscene=yourscenename_or_sceneindex&startactions=any_krpano_actions
e.g.:
https://pavel.ursiny.sk/pano/Art/ZORICAK…kat(-150,0,10);

Pavel

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »pur« (26. November 2018, 23:02)


stevechapdbox

Anfänger

Beiträge: 8

Wohnort: NYC

Beruf: 3D Artist / Designer

  • Nachricht senden

15

Mittwoch, 30. Oktober 2019, 17:09

Been playing around with this and can't get it too completely work, I'd appreciate any insight.

Noticed that in previous threads the syntax was

Quellcode

1
tour.html?start_scene=coolScene



but now it is:

Quellcode

1
tour.html?startscene=coolScene



This works fine to load the specified scene but when I try to change another attribute like fov or hlookat it doesn't quite work.

I've tried various combinations similar to:

Quellcode

1
tour.html?startscene=coolScene&start_fov=85&start_hlookat=20




Is my syntax wrong? I can't seem to change the fov or hlook at all.

Thanks!

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

16

Donnerstag, 31. Oktober 2019, 07:32

Hi)

Thats because URL parameters are passed BEFORE the scene is loaded and the scene has its own VIEW settings.

Try this:

Quellcode

1
?startscene=1&h=90



and add the following into "onstart" of the needed scene (in my test it's second scene)

Quellcode

1
onstart="lookat(get(h), get(v), get(f))"



Hope this helps
Regards,

Alexey

17

Mittwoch, 13. November 2019, 15:50

Hi,

just set the deeplinking setting in the tour.xml to true - then you will get automatically links/urls to the current scene and current view.

Best regards,
Klaus

18

Donnerstag, 21. November 2019, 15:21

Hi Klaus,

I set the deeplinking setting to true but there's no effect on tour at all.
Kindly advise.

Thanks

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

19

Donnerstag, 21. November 2019, 18:39

In what file did you set deeplinking="true" *question*
In the tour.xml file or in the vtourskin.xml file *question*


Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

20

Donnerstag, 25. Februar 2021, 09:46

how to use for PTP - SOLVED

I SOLVED.
Thanks.

Quellcode

1
2
3
hi, 
I could not find how to use it for PTP. How can I go to the scene I want in PTP projects?
1.20.9 krpano installed on panotour pro 2.5.14


Best!
Alican Y.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »sanaltur« (25. Februar 2021, 10:18)