Hotspot to a random panorama   [SOLVED] - View the solution

Share your tips and tricks here or get help with any Panotour 2.0+ problem!
No bug reports (of any kind) in this forum!
User avatar
Siewers
Member
 
Topic author
Posts: 104
Likes: 4 posts
Liked in: 14 posts
Joined: Mon Nov 23, 2015 3:40 pm
Location: Netherlands
Info

Hotspot to a random panorama

by Siewers » Wed Sep 06, 2017 2:01 pm

I'm looking to make a hotspot to let the user navigate to a random panorama in the tour.
Every time the user clicks this button he should navigate to a random panorama.

How could I do this?

User avatar
360-compunics-com-ni
Member
 
Posts: 418
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Hotspot to a random panorama  [SOLVED]

by 360-compunics-com-ni » Thu Sep 07, 2017 5:13 am

Add the following code via the "Include_an_XML"-plugin (http://www.kolor.com/wiki-en/action/view/Panotour_-_Advanced_-_Extra_Plugins#Include_an_XML):
Code: Select all
<krpano>
   <action name="loadRandomScene" keep="true">
      set( MAX, get(scene.count) );
      dec( MAX );
      mul( RAND, random, MAX);
      inc( RAND);         
      roundval(RAND);
      dec( RAND);
      mainloadscene(get(scene[get(RAND)].name) );
   </action>
</krpano>

You can then assign the function call "loadRandomScene();" to a hotspot or button via the "Advanced > Call custom code" action available from the same page.
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829

2 people like this post.

User avatar
Siewers
Member
 
Topic author
Posts: 104
Likes: 4 posts
Liked in: 14 posts
Joined: Mon Nov 23, 2015 3:40 pm
Location: Netherlands
Info

Re: Hotspot to a random panorama

by Siewers » Thu Sep 07, 2017 11:10 am

And is there also a way to select a couple panorama's where it random goes to?

User avatar
360-compunics-com-ni
Member
 
Posts: 418
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Hotspot to a random panorama

by 360-compunics-com-ni » Thu Sep 07, 2017 3:18 pm

That certainly can be done, the way you want to setup or restrict the list of potential random targets would determine the efforts for additional programming. Feel free to contact me at any time to discuss requirements and for an individual quote.
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829

Annis likes this post.

User avatar
Siewers
Member
 
Topic author
Posts: 104
Likes: 4 posts
Liked in: 14 posts
Joined: Mon Nov 23, 2015 3:40 pm
Location: Netherlands
Info

Re: Hotspot to a random panorama

by Siewers » Thu Sep 07, 2017 4:11 pm

I've send you a PM


Who is online

Users browsing this forum: No registered users and 4 guests

cron