solved...: Do something when between hlookat x and y?

  • Hello,

    I'm trying to change a hotspot status when the panorama is rotating through the hotspots area, i.e. without a click.

    So I tried to catch the hlookat and make a condition out of that. First issue was, when I found that hlookat has no limitation in counting up and down. Thats solved according to an older hint of Michel (Thanks again) by using adjusthlookat. Then I rememered, that one can not connect if-conditions so easily, but again I found a solution on that, proposed by Michel (WOW). Nevertheless my action does not work and I don't know why. Any idea?

    What is wrong with the condition part? Am I too blind to see? any syntax error?

    Any help appreciated very much,

    All the best,
    Michael

    Edited 4 times, last by mstoss (October 31, 2012 at 9:12 PM).

  • Well... I can make a hotspot show up in a certain segment of the pano now while panning. But I'm not able to apply an alpha tween. The tweening is working only, when I stop panning. If I start panning during the tween, it will be interrupted. How can I start the alpha tween process and make sure that it is running completely?

  • Thank you very much, that sounds like a good explanation. However, how do I achieve this? I tried stripping most of the action code and I used another condition to make it run only if alpha is still 0, but without success:

    Code
    <action name="a_fader">
    	adjusthlookat(view.hlookat);
    	if(
    		view.hlookat LT 20 	,
     					if(hotspot[flip_f].alpha==0   ,
    					a_showflip(flip_f);
    					);
    	);
    </action>

    This would not be sufficient to hide the hotspot again, but al least it should show up while panning?

  • Hi,

    the logical sequence to make such would be:

    1. detect if the view is inside the target area
    2. if yes, store that information anywhere (custom variable)
    3. in the next view change, check again if the view is still in the target (1.) and also check the previously stored information about inside or outside
    4. now check what to do:
      a) when being outside before and now inside - do the actions for 'entering' the area
      b) when being inside before and now outside - do the actions for 'leaving' the area
      c) when the 'state' hasn't changed - do nothing


    here an example implementation:

    Best regards,
    Klaus

  • Thank you very much Klaus, I will try.

    Michael

    edit: You made my day - it works just fine *smile*

    (BTW: I cannot but admire how you constantly improve the krpano player and still find time to deal with many of the issues, which your users have! )

    Edited once, last by mstoss (October 31, 2012 at 9:12 PM).

Participate now!

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