Creating a Auto Tour Unique to Each Pano.?

  • I've gotten so far as to create a pano from a previous post the uses the step idea. It's brilliant.
    Auto Tour with user control and resume?

    The only trouble is that each pano I have in a tour has interesting things to see at different lookto coordinates. Right now I have

    <krpano version="1.16" title="123 4th Street" onstart="startup();">


    <action name="startup">
    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    skin_hideskin(); <!-- start with control bar minimized -->
    realtor_mobile();<!-- mobile realtor area minimized -->
    playsound("bg", "sound.mp3|sound.wav", 0);<!-- start music loading both filetypes for browers differences -->
    toggle_sound();<!-- start tour with sound off -->
    set(step,1);
    set(idletime,1);
    set(events.onidle, autotour() );
    </action>


    <action name="autotour">
    oninterrupt(break);
    if(step == 1, lookto(150,30,120,smooth(10,50,5)); inc(step); );
    if(step == 2, wait(1); inc(step); );
    if(step == 3, lookto(320,0,120,smooth(10,50,5)); inc(step); );
    if(step == 4, wait(1); inc(step); );
    if(step == 5, lookto(380,30,120,smooth(10,50,5)); inc(step); );
    if(step == 6, wait(1); set(step,1); );
    </action>


    So it works perfectly, for every pano shot in my tour! How can I set up the code so it has a different auto tour action for each pano? (I also noticed that there's an onstart="" for each scene and I'm pretty sure it has something to do with that.


    Thank you for the help!

  • I found out that I can, in fact, get the auto tour to work for an individual pano, but once it's finished executing that one time it switches back to the main one. Would it be possible to put the code:

    set(step,1);

    set(idletime,1);

    set(events.onidle, autotour() );

    in each of it's own action and then simply for each onstart type in the action (like below)?

    <action name="autotour">
    set(step,1);

    set(idletime,1);

    set(events.onidle, autotour() );

    oninterrupt(break);

    if(step == 1, lookto(150,30,120,smooth(10,50,5)); inc(step); );

    if(step == 2, wait(1); inc(step); );

    if(step == 3, lookto(320,0,120,smooth(10,50,5)); inc(step); );

    if(step == 4, wait(1); inc(step); );

    if(step == 5, lookto(380,30,120,smooth(10,50,5)); inc(step); );

    if(step == 6, wait(1); set(step,1); );

    </action>

    And then in the first scene add that?

    <scene name="scene_park_1" title="Park 1 Room" onstart="autotour1();" thumburl="panos/park_1.tiles/thumb.jpg" lat="" lng="" heading="">

    So now if I have 4 panos in a tour I'll create 4 actions and call each one? I've got a feeling it's not going to work.

  • Ok, here's what I tested:


    <krpano version="1.16" title="123 4th Street" onstart="startup();">


    <action name="startup">
    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    skin_hideskin(); <!-- start with control bar minimized -->
    realtor_mobile();<!-- mobile realtor area minimized -->
    playsound("bg", "sound.mp3|sound.wav", 0);<!-- start music loading both filetypes for browers differences -->
    toggle_sound();<!-- start tour with sound off -->
    </action>

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

    oninterrupt(break);
    if(step == 1, lookto(150,30,120,smooth(10,50,5)); inc(step); );
    if(step == 2, wait(1); inc(step); );
    if(step == 3, lookto(320,0,120,smooth(10,50,5)); inc(step); );
    if(step == 4, wait(1); inc(step); );
    if(step == 5, lookto(380,30,120,smooth(10,50,5)); inc(step); );
    if(step == 6, wait(1); set(step,1); );
    </action>

    <action name="autotour1">
    set(step,1);
    set(idletime,1);
    set(events.onidle, autotour1() );

    oninterrupt(break);
    if(step == 1, lookto(75,30,120,smooth(10,50,525)); inc(step); );
    if(step == 2, wait(1); inc(step); );
    if(step == 3, lookto(32,0,10,smooth(10,50,525)); inc(step); );
    if(step == 4, wait(1); set(step,1); );
    </action>

    And then in the scenes I have:

    <scene name="scene_blue_skies" title="Blue Skies Room" onstart="autotour();" thumburl="panos/blue_skies.tiles/thumb.jpg" lat="" lng="" heading="">
    ...
    </scene>

    <scene name="scene_park_1" title="Park 1 Room" onstart="autotour1();" thumburl="panos/park_1.tiles/thumb.jpg" lat="" lng="" heading="">
    ...
    </scene>

    Ideally what I'd like there is that it does the autotour for the first one and then autotour1 for the second pano and so on. Here's the issues I see with this code:
    > The menubar that's supposed to be hidden at the beginning is now showing until a user action is taken (clicking or moving the pano)
    > After navigating to the next scene the startpoint is way off the first lookat so the view is quickly whipped over to the first coordinates
    > The title of the next scene doesn't change to the name of the second scene until after a full execution of the autotour1() action

    ---UPDATE---

    I changed up the code a bit to include the step setup in the startup action:

    <krpano version="1.16" title="123 4th Street" onstart="startup();">

    <action name="startup">
    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    skin_hideskin(); <!-- start with control bar minimized -->
    realtor_mobile();<!-- mobile realtor area minimized -->
    playsound("bg", "sound.mp3|sound.wav", 0);<!-- start music loading both filetypes for browers differences -->
    toggle_sound();<!-- start tour with sound off -->
    set(step,1);
    set(idletime,1);

    </action>

    <action name="autotour">
    set(events.onidle, autotour() );

    oninterrupt(break);
    if(step == 1, lookto(150,30,120,smooth(10,50,5)); inc(step); );
    if(step == 2, wait(1); inc(step); );
    if(step == 3, lookto(320,0,120,smooth(10,50,5)); inc(step); );
    if(step == 4, wait(1); inc(step); );
    if(step == 5, lookto(380,30,120,smooth(10,50,5)); inc(step); );
    if(step == 6, wait(1); set(step,1); );
    </action>

    <action name="autotour1">
    set(step,1);
    set(idletime,1);
    set(events.onidle, autotour1() );

    oninterrupt(break);
    if(step == 1, lookto(75,30,120,smooth(10,50,525)); inc(step); );
    if(step == 2, wait(1); inc(step); );
    if(step == 3, lookto(32,0,10,smooth(10,50,525)); inc(step); );
    if(step == 4, wait(1); set(step,1); );
    </action>

    <scene name="scene_blue_skies" title="Blue Skies Room" onstart="autotour();" thumburl="panos/blue_skies.tiles/thumb.jpg" lat="" lng="" heading="">
    ...
    </scene>

    <scene name="scene_park_1" title="Park 1 Room" onstart="autotour1();" thumburl="panos/park_1.tiles/thumb.jpg" lat="" lng="" heading="">
    ...
    </scene>


    This fixes the first problem with the menubar starting popped out. I modified the smooth function from 525 to 5 and that slowed it down. All that's left is the name of the scene doesn't change until a full rotation of the if statements.

    3 Mal editiert, zuletzt von Tebasaki (27. November 2013 um 18:20)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!