Switch between scenes based on scene name

  • Hi,

    Just started using Krpano and i'm trying to figure out what's the best approach to achieve the following :

    I have a tour with 3 different rooms. Each room can be displayed in 9 different variations based on time and floor type.


    TIME
    -morning
    -noon
    -evening

    FLOOR
    -oak
    -ash
    -maple


    SCENE NAME EXAMPLE

    scene_kitchen_morning_oak
    scene_kitchen_morning_ash
    .................................
    .................................
    scene_kitchen_noon_ash
    scene_kitchen_noon_maple
    ................................
    .
    .................................
    .................................
    scene_kitchen_evening_ash
    s
    cene_kitchen_evening_maple

    scene_living_morning_oak
    scene_living_morning_ash
    ..................................
    ..................................
    .................................
    scene_living_evening_ash
    scene_living_evening_maple


    I plan to use 2 buttons , each with its own options for TIME and FLOOR TYPE visible on all scenes. How would the code look like when I move from one room to another using hotspots or radar hotspots keeping the current scene selection?

    EXAMPLE :

    If the current scene is [scene_kitchen_noon_ash] when i move to the living room i wanna go to [scene_living_noon_ash].


    Thanks in advance,
    Alex

  • Instead of using regular loadscene you can use your own loadscene action. E.g.:

    Code
    <action name="your_load_scene_action">
    <!--set(tour_time,morning);
    set(tour_floor,oak);		-->
    txtadd(scene2load,%1,'_',get(tour_time),'_',get(tour_floor));
    <!--trace(get(scene2load));		-->
    loadscene(get(scene2load),MERGE,BLEND(0.5));
    </action>


    In this case take care to set variables tour_time and tour_floor correctly.
    If you are using system where each hotspots is having linkedscene attribute use it same way but calling your action. Hotspot style example:

    Code
    onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); your_load_scene_action(get(linkedscene)); skin_updatescroll(); );"


    regards
    Umalo

  • Hi!


    You can define anywhere daytime like set(daytime,noon); in some switcher for example
    or even in url : http://www.mysite.com/tour.html?daytime=noon

    Regards

    Andrey

Jetzt mitmachen!

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