Hiding hotspots when not directly in front of the view (VR)

  • In VR mode I'd like to hide all hotspots that aren't in front of the crosshairs and within a defined area surrounding the crosshairs.

    Look at this video for example: https://www.youtube.com/watch?v=Wf2SJ-9qK18

    It makes for a much smoother experience, as we are looking to add a fair number of hotspots providing information, movement to other panos etc - it just becomes a fairly cluttered view with all of them visible all the time.

    Probably not possible now (?) but perhaps it makes sense to add this to a future version ?

  • Been doing this for many years.
    You cycle through all the hotspots ath/atv with sphere to screen. Then filter the return coordinates to decide if you want your hotspot to show or not.
    Works well for projects with 10,000 hotspots at once.

    I think I figured out a way to check if a hotspot is within the viewing quadrant I want to set as boundary. I was planning on doing this on the onviewchanged event, but that event seems to fire 40-odd number of times while loading the scene and it's hotspots - this is before I have started moving the view mind you. It fires 12 (of those 40) after onloadcomplete is fired.

    In other words, I have no way of knowing when to actually start with the loop that "shows/hides" the hotspots - it seems like it would be a bit of a resource hog to perform that loop 40 times initially...any suggestions?

  • Yeah i spent ages on my code to handle 10,000 hotspots.
    One tweak ill share is setting a variable at the start of onviewchange and then delete it with a delayedcall some time later and chech that in your loop so that you dont run the code everyframe of onviewchange.

    That should be enough hints for normal numbers of hotspots. ;)

  • Yeah i spent ages on my code to handle 10,000 hotspots.
    One tweak ill share is setting a variable at the start of onviewchange and then delete it with a delayedcall some time later and chech that in your loop so that you dont run the code everyframe of onviewchange.

    That should be enough hints for normal numbers of hotspots. ;)

    I've done quite a bit of testing on this, and no matter what I do, it stutters when in VR mode. It works pretty smooth in "regular" viewing mode, but not in VR - have you tried it in VR with success ?

    I haven't used a timer, but I use a very simple calculation to determine if it should perform a loop through hotspots based on how far the view has moved since last checking the visibility-status of the hotspots. The logic seems sound to me, but the performance isn't up to scratch in VR mode...

  • Hi,

    here an example code for doing such:

    Code
    <events onviewchange="update_hotspot_visiblity()" />
    
    
    <action name="update_hotspot_visiblity">
    for(set(i,0), i LT hotspot.count, inc(i),
      copy(hs, hotspot[get(i)]);
      getlooktodistance(d, hs.ath, hs.atv);
      calc(hs.visible, d LT 45);
     );
    </action>

    For normal cases (not 10000 hotspots ;-)) this should be fast enough...
    Or for even more performance implement the same as Javascript action.

    Btw - with the next release, the actions codes will be faster (especially loops) and also a the rendering.

    Best regards,
    Klaus

Participate now!

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