Lookto not working properly with before&after sliders.

  • Hello. I'm working on a pano with lookto buttons so that when you click a button, it looks at a different area of the pano. I have that part working as expected.

    I also want to add in a before/after slider. I have that working as well, but now when I click a button it zooms all the way into the pano and then resets once it gets to its rotation point.

    I am trying to get it to just look without zooming, but I can't figure out what to change.

    Look to buttons working as expected:

    When I add the before/after slider, it zooms all the way in before getting to the view angle:

    Thanks for any help,

    Here is the XML for the version with the before&after...

  • Hi,

    i'm on phone.. but it looks like you do first a looktohotspot and then a lookto with fov 0.. nit sure if that makes sense in your case.. but..
    Yeah.. fov 0 is quite zoomed in indeed *wink*
    Perhaps try instead of the thirth number in the lookto (0): *view.fov

    Hope it helps,
    Tuur *thumbsup*

  • Yep, that portion of the code could definitely be cleaned up, but it wasn't what was causing my problem in this case.

    I had grabbed the Before/Afterr slider from Kaus examples. I removed what code I knew I didn't need, but I didn't remove all of it as I don't know what a lot of it does. When I removed the struck-out portion below, the tour once again started functioning how I intended. Now back to work on the interface. :)

    Current fixed iteration..

    This portion of code was causing the problem..
    <action name="sync_viewers" type="js">
    var viewFrom = krpano.view;
    var viewTo1 = krpano.layer.getItem("krpano1").krpano.view;
    var viewTo2 = krpano.layer.getItem("krpano2").krpano.view;

    viewTo1.hlookat = viewTo2.hlookat = viewFrom.hlookat;
    viewTo1.vlookat = viewTo2.vlookat = viewFrom.vlookat;
    viewTo1.camroll = viewTo2.camroll = viewFrom.camroll;
    viewTo1.fovtype = viewTo2.fovtype = viewFrom.fovtype;
    viewTo1.fov = viewTo2.fov = viewFrom.fov;
    viewTo1.fisheye = viewTo2.fisheye = viewFrom.fisheye;
    viewTo1.architectural = viewTo2.architectural = viewFrom.architectural;
    viewTo1.pannini = viewTo2.pannini = viewFrom.pannini;
    viewTo1.tx = viewTo2.tx = viewFrom.tx;
    viewTo1.ty = viewTo2.ty = viewFrom.ty;
    viewTo1.tz = viewTo2.tz = viewFrom.tz;
    viewTo1.ox = viewTo2.ox = viewFrom.ox;
    viewTo1.oy = viewTo2.oy = viewFrom.oy;
    viewTo1.oz = viewTo2.oz = viewFrom.oz;
    viewTo1.rx = viewTo2.rx = viewFrom.rx;
    viewTo1.ry = viewTo2.ry = viewFrom.ry;


Participate now!

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