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.

  • "Sudarchikov Andrey" started this thread

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

1

Monday, August 26th 2013, 2:20pm

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

Source code

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

This post has been edited 1 times, last edit by "Sudarchikov Andrey" (Mar 1st 2014, 12:21pm)


2

Monday, August 26th 2013, 3:11pm

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

  • "Sudarchikov Andrey" started this thread

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

3

Monday, August 26th 2013, 7:25pm

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 has attached the following file:
  • paramsDemo.zip (178.17 kB - 490 times downloaded - latest: Mar 29th 2023, 2:45pm)
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Arsdezi

Intermediate

Posts: 174

Location: Ukraine

  • Send private message

4

Monday, September 2nd 2013, 7:43pm

Well done!
It's working!

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

This post has been edited 1 times, last edit by "Arsdezi" (Sep 4th 2013, 5:13am)


5

Sunday, April 20th 2014, 5:01pm

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

Trainee

Posts: 66

Location: Nederland

Occupation: Logistics Specialist – Planning & Logistics

  • Send private message

6

Saturday, May 3rd 2014, 6:39pm

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

Masterwork done by Andrey. *thumbsup*

Stefan.L

Trainee

Posts: 102

Location: Sweden

Occupation: Photography/ webdesign

  • Send private message

7

Wednesday, October 22nd 2014, 2:38pm

Very useful! Great!
Best regards - Stefan

8

Sunday, July 12th 2015, 12:22am

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 :)

  • "Sudarchikov Andrey" started this thread

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

9

Sunday, July 12th 2015, 9:11pm

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

Friday, August 14th 2015, 5:09pm

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

This post has been edited 1 times, last edit by "sebastianm" (Aug 14th 2015, 8:57pm)


11

Thursday, November 15th 2018, 7:57pm

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

Sunday, November 18th 2018, 10:18pm

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

Wednesday, November 21st 2018, 10:17pm

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

Monday, November 26th 2018, 10:50pm

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

Source code

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

This post has been edited 1 times, last edit by "pur" (Nov 26th 2018, 11:02pm)


Posts: 8

Location: NYC

Occupation: 3D Artist / Designer

  • Send private message

15

Wednesday, October 30th 2019, 5:09pm

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

Source code

1
tour.html?start_scene=coolScene



but now it is:

Source code

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:

Source code

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!

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

16

Thursday, October 31st 2019, 7:32am

Hi)

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

Try this:

Source code

1
?startscene=1&h=90



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

Source code

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



Hope this helps
Regards,

Alexey

17

Wednesday, November 13th 2019, 3:50pm

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

Thursday, November 21st 2019, 3:21pm

Hi Klaus,

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

Thanks

spacerywirtualne

Professional

Posts: 1,106

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

19

Thursday, November 21st 2019, 6:39pm

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

Thursday, February 25th 2021, 9:46am

how to use for PTP - SOLVED

I SOLVED.
Thanks.

Source code

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.

This post has been edited 2 times, last edit by "sanaltur" (Feb 25th 2021, 10:18am)