Following arrows WebVR menu with Previous/Next scene and pano_xx_set_xx scheme - NEED Help

  • I have this folder structure :

    Set_01 /
    Pano_01
    Pano_02
    Pano_03

    Set_02 /
    Pano_01
    Pano_02
    Pano_03
    Pano_04

    Set_03 /
    Pano_01
    Pano_02



    My scenes are dynamically created (scene.index stay '0'),
    But I can get their name (ex : pano_03_set_01 )
    and want to be able to navigate to next scene (ex : pano_01_set_02 ) or previous scenes (ex : pano_02_set_01 )
    knowing the name of the current one .

    So i need 2 actions move_next(); and move_previous();

    i think i have to declare variables like
    - the number of panos per set :
    set(set_01_count, 3);
    set(set_02_count, 4);
    set(set_03_count, 2);
    - the name of first pano and last panos to compare for looping :
    set(first_pano, pano_01_set_01);
    set(last_pano, pano_03_set_02);

    so logic should be :
    -get the current scene name
    -extract pano number and set number
    -convert to an index ?
    -compare to known variables (if pano number LT or GT than set_count, inc +1 (for next) dec -1 (for previous))
    -...etc *cry*

    but i think there a easier way to do that, any skilled people out there ?

    thanks *smile*

    D

  • In case your groups are organized like to posted, scene names are: pano_01_set_01, pano_02_set_01, pano_03_set_01, pano_01_set_02, pano_02_set_02.... just make sure to set

    Code
    <skin_settings ... thumbs_loop="true"


    and open your vtourskin.xml and replace old action skin_nextscene_loop with this:

    See live working demo: http://webonjee.com/radna-mapa/ant…ping/index.html

  • Thanks Umalo *smile*

    but i don't use the VTour example, source is custom hand-made,
    i'll look in your piece of code if i can do something with...

    for the loop at the end, may be i must declare as variable the name of the very last (pano_02_set_03 in this case)
    and if it's loaded then go NEXT to the very first : pano_01_set_01..

    D

  • It works exactly as you asked for, looping through all panos from the set. Currently you have loaded set 2 so it loop this 2 panos. To switch to another set you need to make another code. E.g. place some buttons for set switching. Then load scene from that set and looping will do the same for active set the same.

  • ok,
    sorry in my mind i was thinking jumping to next or previous pano within all sets,
    i wasn't clear enough,
    ok i'll try to play with your code

    Thanks

    D

  • Still not clear to me what you want at the end. Original Klaus code in action skin_nextscene_loop is looping through all scenes defined. If you want that functionality take this code and use it. I made you looping through one set as when having arrows, thumbs.... user can move to next set and then looping will again loop through all scenes from that set.

Participate now!

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