Limit views on 400 degrees?

  • I'm wondering if it's easily possible to limit the right or left degree of rotation when the possible rotation is more than 360 degrees. What? Yes bear with me on this one.

    What I want to do is to set a right limit beyond the left limit and vice verses. That is went you rotate horizontally right, you can go to say hlookatmax 60 and when you move to the left you can go to say hlookatmin 40. This is using the limitview range setting.

    While I've looked through the forum for any earlier question on this, did not find one, I have not tried it yet, but seem to remember from earlier test that this type of hlookatmax/min span that was greater than 360 simply was the same thing as no limits.

    I guess it might be possible to check the hlookat and once past a certain point set a new limit and then do the reverse.

    Any ideas?

    Regards,

    Robert

  • Hi,

    the default viewing limitations can't be used for more than 360 degree around, but you could use the onviewchange event and do the limitation yourself by modifying the hlookat value.

    e.g.

    Code
    <view limitview="off" />
    
    
    <events onviewchange="customlimits();" />
    
    
    <action name="customlimits">
      if(view.hlookat LT -200, set(view.hlookat, -200));
      if(view.hlookat GT +200, set(view.hlookat, +200));
    </action>

    best regards,
    Klaus

Participate now!

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