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.

image360

Intermediate

  • "image360" started this thread

Posts: 204

Location: Austin, TX and Chicago, IL

Occupation: Photographer

  • Send private message

1

Sunday, October 4th 2009, 8:12pm

Auto Tour with user control and resume?

Has anyone figure out a good XML solution to have an auto tour - self running moveto, wait, moveto, wait, goto new pano, popup image or text, etc,, then moveto, wait, system that allows the user to sit back and watch, but interrupt the progression, look around and then restart from the interruption point?

I want to build a simple tour that auto runs but allows the user to control it when they want to, and then restart it from the point they took control of it.

Any ideas?

Regards,

Robert

2

Monday, October 5th 2009, 10:57pm

Hi,

e.g. this would/could be a solution:
- use the "onidle" event or a button to start the auto tour
- use a custom variable ("step" in the example below) to count which step the tour has reached
- increase this variable (step) after each tour action
- use oninterrupt to break/stop the tour
- use if() to check at which current step the tour is and call a action for this step
- when this autotour action was interrupt and called later again, it will continue at the last step

here this as xml code: (for 1.0.8 beta or newer)

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<krpano onstart="setuptour();">

<action name="setuptour">
  set(step,1);
  set(idletime,4);
  set(events.onidle, autotour() );
</action>

<action name="autotour">
  oninterrupt(break);
  if(step == 1, lookto(...); inc(step); );
  if(step == 2, moveto(...); inc(step); );
  if(step == 3, lookto(...); inc(step); );
  if(step == 4, wait(2); inc(step); );
  if(step == 5, lookto(...); inc(step); );
  if(step == 6, tourdone(...); set(step,1); );
</action>

...

</krpano>


best regards,
Klaus

image360

Intermediate

  • "image360" started this thread

Posts: 204

Location: Austin, TX and Chicago, IL

Occupation: Photographer

  • Send private message

3

Monday, October 5th 2009, 11:56pm

Thank you

Klaus,

Thank you for your help! I will try this, it looks like it meets my needs very well. Thank you again.

Best Regards,

Robert

image360

Intermediate

  • "image360" started this thread

Posts: 204

Location: Austin, TX and Chicago, IL

Occupation: Photographer

  • Send private message

4

Tuesday, October 6th 2009, 5:34pm

Linear or Object based process?

I've been testing the code structure kindly provided by Klaus to setup an auto tour with user interruption and resume.

In the initial very basic work, I've found I have to use Tween so I can control the speed or timing of movement around the view.(OK, now see the moveto and others have speed control.) But I've also found that I have to use Wait before an step increment and set the timing or the next conditional is executed before the action of the first step is finished.

So I'm guessing that each action is fully loaded and acted upon in a object fashion as opposed to a linear process. Is this correct or what else am I missing as I continue to add complexity into the auto tour.

Here's a small sample of what I've done, without the wait at the end of the first set of tweens - before the step increment - the last tween set, after the wait(17), is executed in the second pano, not the first one as intended.

<action name="autotour">
oninterrupt(break);
if(step == 1, tween(view.fov,90,20,linear);tween(view.hlookat,370,20,linear);tween(view.vlookat,0,20,linear);wait(17); tween(view.fov,30,5,easeInOutSine); tween(view.hlookat,82,5,easeInOutSine); wait(8); inc(step); );
if(step == 2, loadpano(DiningRoom_MG_8170 Panorama.xml,null,KEEPBASE|NOPREVIEW,BLEND(2)); wait(2); inc(step); );
...

Just trying to understand this tool, one small tween at a time *smile*

Regards,

Robert

This post has been edited 1 times, last edit by "image360" (Oct 6th 2009, 7:23pm)


5

Wednesday, October 7th 2009, 3:00pm

Hi,

the tween() action starts only a 'process' to change a value during the time,
but after starting it, the next action will be processed,
this allows to tween() several values at once,

different to that the lookto/moveto/zoomto actions are 'blocking' actions,
they are changing the view, and while changing all other things are blocked (user input, actions execution),
so the next actions will be executed when they are done,

about the tween - to get notified when a tween has ended, there is the "donecall" parameter,
there actions can be placed that will be executed when the tween has reached the destination value,

note - in 1.0.8 beta - there is a new special value for the donecall parameter: WAIT,
with it the tween acts like the lookto/moveto/.. actions and waits until the tween has finished
before executing the next actions,

e.g.

Source code

1
tween(value, 100.0, 1.0, linear, WAIT);



best regards,
Klaus

6

Thursday, March 19th 2015, 5:50pm

Hi Klaus,
I am using your example and added a button to start the autotour.
But how can I switch the tour off??? It always starts again after the idle-time...
I would like to have a button with directly starting and stopping the autotour without starting again...

thanks

Felipeca

Beginner

Posts: 32

Location: México City

Occupation: Dsigner, 3dmodeler and photographer

  • Send private message

7

Thursday, March 19th 2015, 11:24pm

How we do it

This is what we use:
<krpano version="1.18" title="CECC" onstart="startup();" idletime="75">

<events onidle="skin_nextscene_loop(+1);set(autorotate.enabled,true);" />


The "skin_nextscene_loop" is borroed directly from the default skin xml.