Sync (Comparison) Plugin - Different Headings?

  • Hi,

    I am using the sync plugin https://krpano.com/releases/1.20.…syncscreen.html with the only difference being that the plugin is enabled after a button click to sync both viewers, so that the images can be manually aligned before syncing movement.

    The issue I have is that the images are not necessarily in the exact same location with the same heading.

    The first change I made was to the sync.xml where I disabled the mirroring of the fov between viewers:


    // don't sync fov (zoom) level
    // view1.fov = view2.fov;

    This works great, but now the next issue is that I am trying to solve is the mirroring of the hlookat for each viewer. I can't comment it out as then I get no horizontal movement on the other viewer, but I can't seem to work out how to keep a constant offset either.

    For example, viewer1 is facing east and viewer2 is facing north, I'd like to be able to move around each with a constant horizontal difference of 90 degrees.

    I've tried different things but haven't gotten anything to work yet:


    // don't want to simply copy hlookat but keep a constant offset between view1 and view2
    // view1.hlookat = view2.hlookat;

    var hlookatDiff = view2.hlookat - view1.hlookat;
    view1.hlookat = hlookatDiff;


    but I'm really just guessing trying to find a solution that works.

    Appreciate any suggestions.

    Cheers,
    Martin

  • Thanks for the reply Klaus - much appreciated.

    I couldn't get it to work using the prealign but I managed to get it working by doing this in my function that starts the sync:


    panoLeft.set("horizontalOffset", panoLeft.get('view.hlookat') - panoRight.get('view.hlookat'));
    panoRight.set("horizontalOffset", panoLeft.get('view.hlookat') - panoRight.get('view.hlookat'));


    then in sync.xml


    view1.hlookat = view2.hlookat - krpano.get('horizontalOffset');

Jetzt mitmachen!

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