Conditional hotspot for VR (stereo)

  • Hi all,

    I have a hotspot that I need to behave in one way when in VR mode and another way when not in VR mode. As an example, I tried this kind of code:


    url.no-stereo="images/large.png"
    url.stereo="images/small.png"

    or

    url.no-webvr="images/large.png"
    url.webvr="images/small.png"


    since I've seen:

    url.no-mobile="images/large.png"
    url.mobile="images/small.png"

    as examples, but nothing seems to work. Anyone know how to pull something like this off? It's fine if they end up being two different hotspots-- I just need to make sure I can get each one to only be on in the appropriate stereo mode.

    Thanks!

  • Try using 'if" check inside the hotspot attributes. For example, you have 1 spot in a scene, duplicate it and assign

    Code
    if="webvr.isenabled == true"

    to one spot and

    Code
    if="webvr.isenabled == false"

    to another. The solution may be easier, however, that depends on what is the exact difference between your spots for VR and for normal view mode.

  • Try using 'if" check inside the hotspot attributes. For example, you have 1 spot in a scene, duplicate it and assign

    Code
    if="webvr.isenabled == true"

    to one spot and

    Code
    if="webvr.isenabled == false"

    to another. The solution may be easier, however, that depends on what is the exact difference between your spots for VR and for normal view mode.

    Try using 'if" check inside the hotspot attributes. For example, you have 1 spot in a scene, duplicate it and assign

    Code
    if="webvr.isenabled == true"

    to one spot and

    Code
    if="webvr.isenabled == false"

    to another. The solution may be easier, however, that depends on what is the exact difference between your spots for VR and for normal view mode.

    Thanks Alexey but dropping that code in seems to make the hotspots disappear no matter what mode I'm in. I think the real problem is that neither 'stereo' nor 'webvr' seems to be recognized as a true/false condition that changes with VR enabled or not... gah.

  • Hm... as far as I know, when you enter VR mode (in standard Krpano tour skin, at least), the scene is being reloaded and the whole "scene" content is being parsed again, so assigning "if" check for "webvr.isenabled" inside hotspots (not inside style) must be working. Only few days ago I made some tests with VR and remember I was using this check. However, maybe I'm wrong here. Btw, what is the final purpose of all this? Do you want to asign different urls for the same hotspots while in VR?

  • Sorry, it seems I was wrong about scene re-parsing when entering VR mode. VR images are reloaded (from multires to vr-ready). So the way is to use some for(); and try change hotspots on the fly when entering VR mode.

    Hi Alexey-- thanks for looking into this for me. Basically yes, I have two hyperlinks-- one for VR and one for nonVR, so I want to make sure the hotspot keeps the VR user in VR and the nonVR user not in VR.

    I'm still new to XML-- would you mind writing out the code for a sample hotspot so I can understand how the for(); statement might be of use here? Thanks so much!

Jetzt mitmachen!

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