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

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

    best regards,
    Klaus

  • 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

    Edited once, last by image360 (October 6, 2009 at 7:23 PM).

  • 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.

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


    best regards,
    Klaus

  • 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

  • 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!