You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, March 26th 2020, 1:21pm

Sync (Comparison) Plugin - Different Headings?

Hi,

I am using the sync plugin https://krpano.com/releases/1.20.5/viewe…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

This post has been edited 1 times, last edit by "martincarlin87" (Mar 26th 2020, 1:32pm)


2

Thursday, March 26th 2020, 8:41pm

Hi,

you could use the image.prealign setting:
https://krpano.com/docu/xml/#image.prealign

E.g. to rotate the pano image 90 degree in horizontal direction:

Source code

1
2
3
<image ... prealign="0|90|0">
  ...
</image>


Best regards,
Klaus

3

Friday, March 27th 2020, 1:26pm

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');