trouble with limiting pitch (vlookat) in panorama viewer

  • We have some code to limit the pitch in our panorama viewer.
    This code is in our flash plugin, and we are currently using krpano version: 1.0.8.15-2012-08-10.
    Sometimes this code works (and the pitch is limited) and sometimes it doesn't work (and the pitch is not limited):

    Code
    public function setRestrictedViewRange(minPitch:Number, maxPitch:Number):void
    {
    trace("setRestrictedViewRange: limitview=range,minPitch=" + minPitch + ",maxPitch=" + maxPitch);
    viewinterface.limitview = "range";
    viewinterface.vlookatmin = -minPitch;
    viewinterface.vlookatmax = -maxPitch;
    }

    Can you tell us any circumstances when setting vlookatmin would not work (or would be ignored)?
    It appears as if this works only *after* calling the krpano action loadxml to show the panorama media (and then calling the method above to reset the look direction limits). Is that one of the contexts in which vlookatmin might not work?

    Another way to ask the same question - under what circumstances are the look direction limits flushed? Perhaps after calls to loadxml?

    Thanks,
    Chuck

    Edited once, last by cedoucette (May 20, 2013 at 11:42 PM).

  • Thank you for your reply. Unfortunately, I am still confused and have not developed a working solution.

    You said: "the viewing limits will be reseted with each new pano". What actions imply that a new pano has been loaded - loadxml (or loadpano/loadscene)? When is the proper time to set view limits - before/after doing what action?

    Thanks,
    Chuck

  • Hi,

    the loadpano, loadscene and loadxml actions are causing the loading of a new pano and in all these cases the viewing limits will be set back to default.

    You could either just define a <view> element for the pano use the onstart, onxmlcompelte or onnewpano events to set custom view limits.

    Best regards,
    Klaus

Participate now!

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