Using Little Planet Fly in an Autotour in same xml

  • I''ve managed to get a Little Planet fly in to work and I've managed to get an autotour script to work; however, when I try to put them both in the same script - no luck. My experience with xml scripting is limited so I don't know what order the pieces must be in to work correctly. Both examples I worked from start with "on start". I assume there can only be one "on start" so how would I get the tour to start when the little planet sequence is finished?

    Little Planet script here:
    <krpano version="1.0.8" onstart="wait(blend); action(intro)">
    <action name="intro">
    tween(view.hlookat, 67, 2.5, easeInOutQuad );
    wait(3);
    tween(view.vlookat, -10, 2.5, easeInOutQuad );
    tween(view.fov, 80, 2.5, easeInOutQuad );
    tween(view.fisheyefovlink, .3, 2.5, easeInOutQuad );
    tween(view.fisheye, 0.33, 2.5, easeInOutQuad);
    tween(view.architectural, .35, 2.5, easeInOutQuad);
    wait(5);
    set(display.flash10,on);
    tween(display.details,32);
    set(display.stillquality,HIGH);
    set(display.stillquality10,HIGH);
    tween(view.fovmax,120);
    </action>

    <image>
    <sphere url="pano.jpg" />
    </image>

    <plugin name="logo"
    url="2012logo2.png"
    align="rightbottom"
    x="10"
    y="10"
    onclick="openurl('http://homepage.com');"
    />

    <view hlookat ="-150.807361"
    vlookat ="85.000000"
    camroll ="0.000000"
    fov ="140.000000"
    fovmin ="50.550680"
    fovmax ="150.000000"
    maxpixelzoom ="1.000000"
    limitfov ="true"
    fisheye ="1.00"
    fisheyefovlink="0.50"
    stereographic ="true"
    architectural ="0.0"
    architecturalonlymiddle="true"
    limitview ="auto"
    hlookatmin ="NaN"
    hlookatmax ="NaN"
    vlookatmin ="NaN"
    vlookatmax ="NaN"
    />
    </krpano>


    Autotour script here:
    <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(67,-10,95,linear(10)); inc(step); );
    if(step == 2, wait(3); inc(step); );
    if(step == 3, lookto(160,-24,50,linear(20)); inc(step); );
    if(step == 4, wait(2); inc(step); );
    if(step == 5, lookto(165,-2,100,smooth(20,20,20)); inc(step); );
    if(step == 6, wait(3); inc(step); );
    if(step == 7, lookto(240,-15,90,smooth(20,20,20)); inc(step); );
    if(step == 8, lookto(240,-15,60,smooth(20,20,20)); inc(step); );
    if(step == 9, wait(2); inc(step); );
    if(step == 10, lookto(360,-25,80,smooth(20,20,20)); inc(step); );
    if(step == 11, lookto(67,-17,115,linear(10)); inc(step); );
    if(step == 12, tourdone(60,-15,90,tween(3, 100.0, 1.0, linear, WAIT); );

    </action>
    <image>
    <sphere url="pano.jpg" />
    </image>

    <plugin name="logo"
    url="2012logo2.png"
    align="rightbottom"
    x="40"
    y="10"
    onclick="openurl('http://homepage.com');"
    />
    </krpano>

    Edited once, last by Nagoyajin (April 21, 2012 at 2:43 AM).

  • Hi,

    there can't be two "onstart" events,

    merge the code into one <krpano> element and merge the onstart calls into one,

    e.g. to call several actions in the onstart event do something like this:
    onstart="actions1(); actions2(); action3(); ..."

    best regards,
    Klaus

  • Thanks!.That works but the auto tour is not triggered until the user moved the cursor in the screen. How can it be triggered the first time with no user intervention?

  • I tried to use idle event but I can't get it to work. Can you point me to an example showing how on idle is used in the xml file? The documentation shows the syntax for the events but I don't see anything about valid arguments or if you need to make some kind of call to it. I'm sure once I get more familiar with krpano's xml scripting some of this will become obvious to me.

  • Have you looked at the example folder (in the viewer download) ? There is an example of the onidle there.

    Keep in mind, there is a tools download and a viewer download.

  • Thanks for the tip on the Krpano examples. I wasn't even aware of that download and had never seen it before. The explanations on the home page are a bit vaauge so it wasn't clear to me that everything I need wasn't included in the Krpanotools download. Any way, I looked for an example using onidle and found this

    <onidle="trace('idle event - no user interaction since ', idletime, ' seconds');"

    This brings me no closer to understanding the use than I was before. From this example it looks to me like 3 parameters would be entered,. The first would be 0 if I want no user interaction needed. Would I enter the number of second sto wait for idle time then the word "seconds' in single quotes? Any example I can look at that actually use the idle event with real numbers input?

  • That's not close to understanding.

    trace is a function that outputs to the debug log
    trace('idle event - no user interaction since ', idletime, ' seconds');"
    quotes around a textstring making a sandwich with a variable idletime.

    outputs
    idle event - no user interaction since 2 seconds

    2 step process
    Set idletime somewhere
    1.
    <krpano idletime="1" >
    2.
    <events onidle="dosomething()" />


    Thanks for the tip on the Krpano examples. I wasn't even aware of that download and had never seen it before. The explanations on the home page are a bit vaauge so it wasn't clear to me that everything I need wasn't included in the Krpanotools download. Any way, I looked for an example using onidle and found this

    <onidle="trace('idle event - no user interaction since ', idletime, ' seconds');"

    This brings me no closer to understanding the use than I was before. From this example it looks to me like 3 parameters would be entered,. The first would be 0 if I want no user interaction needed. Would I enter the number of second sto wait for idle time then the word "seconds' in single quotes? Any example I can look at that actually use the idle event with real numbers input?

  • I'm not trying to figure out how to use trace. That was just what happened to be in the example for on idle I was able to find. All I'm trying to do is to do the the little planet fly-in action then after a second or 2, automatically start the stepped tour action..

  • I'm not trying to figure out how to use trace. That was just what happened to be in the example for on idle I was able to find. All I'm trying to do is to do the the little planet fly-in action then after a second or 2, automatically start the stepped tour action..

    Oh ok. Glad you figured it out.

Participate now!

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