getlooktodistance smaller value ?

  • Hi,
    Using getlooktodistance to select a hotspot when middle of screen is great, but if you have more than one hotspot in the area it's a problem for using onover & onout if you want only one to be activated (the nearest one from the middle)

    Klaus code is :

    Code
    <action name="testhotspots">
        for(set(i,0), i LT hotspot.count, inc(i),
            getlooktodistance(d, hotspot[get(i)].ath, hotspot[get(i)].atv);
            if(d LT 10,
                highlight_hotspot(get(i), get(hotspot[get(i)].name));
              ,
                background_hotspot(get(i), get(hotspot[get(i)].name));
              );
          );
    </action>

    Is there a way to check witch one is the nearest to call onover on this one and onout and all the other ones ?

    THX !!!!

  • Hi,

    you would need to loop through all hotspots and remember the nearest distance.

    Here an example (untested):

    Best regards,
    Klaus

  • Works perfect but it fires onover and onout too many times (each frame onviewchange in fact)
    I made a example here : http://www.360images.fr/angers_360/ind…ano=example.xml

    I can't find a way to fire onout and onover only once...

    If the hotspot is in the middle of the screen then callwith onover, if it goes out then callwith onout, this is not very difficult.

    If the hotspot is in the middle of the screen then callwith onover, but if another one is more close to the center, then callwith onout for the first one...

    A clue ?

  • I have changed the code to check if the new nearest distance is not the already nearest hotspot and I might be wrong, because if you rotate clockwise it works, and if you rotate the other way to onout is not called...

  • Ok, working example ;)

Jetzt mitmachen!

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