How to restrict some hotspots appearing when in VR mode

  • I have a tour with hotspot 'arrows' to guide the viewer around.

    At the start and end of the tour, 'onclick' loads a new html file. Works fine in non VR mode, my issue is that in VR mode loading a new html file will exit VR (which is fine and to be expected) but is confusing if you are still 'inside' the VR experience, i.e. google cardboard.

    So... I'd like to add some code to certain arrows to stop them appearing when in VR mode. Here is my code for the 'arrow' :

    <hotspot name="arrow-0"
    url="../hotspots/yellow-arrow.png"
    alpha="0.8"
    scale="0.5"
    distorted="true"
    rx="-60.0"
    ath="0"
    atv="6"
    zoom="true"
    onhover="showtext(' ',hotspottextstyle);"
    onclick="openurl(next-tour.htm?scenetoload=pano413,_self)"
    />

    Any help, much appreciated.

    Thanks

    Tim

  • You could add a couple of actions like the one explained by Klaus here

    Toggle, hide-unhide HotSpots HTML5/ JS Viewer iPhone/iPad


    You'd need two actions, one assigned to onentervr and one assigned to onexitvr

    For example:

    - In the code of hotspots to be hidden, add an attribute novrspot="yes"
    - add two actions


    Code
    <action name="hidespot">  for(set(i,0), i LT hotspot.count, inc(i),     if(hotspot[get(i)].novrspot == yes,         set(hotspot[get(i)].visible,false);       );    );</action>


    Code
    <action name="showspot">  for(set(i,0), i LT hotspot.count, inc(i),     if(hotspot[get(i)].novrspot == yes,         set(hotspot[get(i)].visible,true);       );    );</action>


    - Call the actions at onentervr and onexitvr
    eg. <plugin name="WebVR" ... onentervr="... hidespot();" onexitvr="... showspot();"


    - Can also add this to the hotspots code

    Code
    onloaded="if(webvr.isenabled == true, set(visible, false);); if(webvr.isenabled == false, set(visible, true););"

    This will ensure the hidden hotspots don't reappear after switching/reloading scenes while still in VR Mode.

  • Hi Guys

    Thanks for the advice.

    I created a group which contains the 'enter VR ' layer. and then I turn the group 'on/off' in each pano via:

    set (plugin[group5].visible,false);

    or set (plugin[group5].visible,true);

    Then added:

    onloaded="if(webvr.isenabled == true, set(visible, false);); if(webvr.isenabled == false, set(visible, true););"

    To the arrows at the start and end of each tour (which normally call another html tour).

    So this way visitor can only enter VR when then are within the body of the tour and arrows to other external tours no longer appear at 'each end' of the current tour.

    Thanks again for suggestions.

    Tim

Jetzt mitmachen!

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