You are not logged in.

  • "claire_france" started this thread

Posts: 18

Location: Glasgow

Occupation: Virtual Tours, Photography, PHP & mySQL

  • Send private message

1

Saturday, March 15th 2014, 5:45pm

Varying the start location of a virtual tour

Hi, Is it possible to vary the start location of a tour such that different links from a web page to the same tour file result in a different start locations.

Previously, with ptviewer, I would do this using PHP to set the start location according to a querystring variable, but I don't know how to do this within XML

Any pointers gratefully received.

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Saturday, March 15th 2014, 6:36pm

Hi,
You could generate a random number, which could be the scene number.

http://krpano.com/docu/actions/#random

So generate a number, and then loadscene(scene', get(yourrandomnumber), etc etc
And load that scene.

You can also search the forum a bit, i'm sure there are more ways to Glasgow *g*
Hope it helps,
Tuur *thumbsup*

  • "claire_france" started this thread

Posts: 18

Location: Glasgow

Occupation: Virtual Tours, Photography, PHP & mySQL

  • Send private message

3

Monday, March 17th 2014, 10:10am

Hey thanks,

I was wanting to start the tour in a specified location rather than random. I guess that would go the same way? I'll investigate.

Just in case I'm barking up the wrong tree, I'll rephrase the question.
I have a number of scenes defined in the XML and the tour is initialised with the code

<krpano version="1.17" title="" onstart="startup();">

<action name="startup">
if(startscene === null, copy(startscene,scene[0].name));
loadscene(get(startscene), null, MERGE);
</action>

Then in the HTML:
<script>
embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"prefer", passQueryParameters:true});
</script>

Is there a way of passing the start scene number from the HTML, so that I can start the tour from different places with different incoming links?

Thanks again,
C

  • "claire_france" started this thread

Posts: 18

Location: Glasgow

Occupation: Virtual Tours, Photography, PHP & mySQL

  • Send private message

4

Monday, March 17th 2014, 10:53am

Got there, using the vars:{} function.

embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"prefer", passQueryParameters:true, vars:{startscene:"scene_name"}});

& scene_name can be set using PHP, or whatever.