I need help get hlookat vlookat positions

  • hello, I'm trying to make a layer that is located in the center, pan around 4 different and close positions, indicating how a pane moves. everything works perfectly for me, but only in the starting position.
    this is the code:

    <layer name = "helpa" style = "" keep = "true" url = "hotspots / helpa.png" align.
    desktop = "bottomright" x.desktop = "190" y.desktop = "5" align.tablet = "topright" x.tablet = "5" y.tablet = "15" zorder = "99"
    alpha = "0.8" scale = "0.8" visible = "true" enabled = "true"
    onclick = "switch (autorotate.enabled); action (skin_hideskin); set (layer [tg] .visible, true); action (skin_hideskin); set (layer [tg] .visible, true);
    delayedcall (1, lookto (187,0.0,120,
    smooth (6,25,12)));
    delayedcall (3, lookto (173,0.0,120, smooth (6,25,12)));
    delayedcall (6, lookto (180,7.0,120, smooth (6,25,12)));
    delayedcall (9, lookto (180, -7.0,120, smooth (6,25,12)));
    delayedcall (12, lookto (180,0.0,120, smooth (6,25,12)));
    delayedcall (13, set (layer [tg] .visible, false)); action (skin_showskin); switch (autorotate.enabled); "
    />

    Being in a different position than the initial one, everything gets complicated, I have tried many variables but I can't get it.
    How do I make the onclick order take the current position and simply increment or decrement the amount needed in Hlookat and vlookat.
    I appreciate any hint

    Ramiro

  • I pick up this thread in order to get help.
    The idea is that when I click on the help button at the bottom right, an icon becomes visible by moving the panorama to four different positions as hlookat and vlookat, and then the icon disappears when you return to the initial position.
    Everything works perfectly in the initial position with values 0.0. But when I click on another position other than the initial one, it does not work correctly, since it is in other coordinates as for hlookat.
    the code is this
    onclick = "set (layer [tg] .visible, true);
    delayedcall (1, lookto (8,0.0,120, smooth (6,25,12)));
    delayedcall (3,
    lookto (-8,0.0,120, smooth (6,25,12)));
    delayedcall (6, lookto (0,0.0,120, smooth (6,25,12)));
    delayedcall (9, lookto (0, -8.0,120, smooth (6,25,12)));
    delayedcall (11, lookto (0.8.0.120, smooth (6.25.12)));
    delayedcall (14, lookto (0,0.0,120, smooth (6,25,12)));
    delayedcall (16, set (layer [tg] .visible, false)); action (skin_showskin);
    "
    />

    You can see the intent here:

    https://www.ciudadcubica.com/prueba1/
    I have tried other possibilities like this but not succeeding:
    delayedcall (1, lookto (get (h) + offset8, get (v), get (f); smooth (6,25,12)));
    A clue would be of great help to me

  • tested, works.

  • thanks indexofrefraction for your reply.
    I tried it, but the icon shows and disappears, without moving in this period.
    When the icon disappears, the panorama is immobile

  • the code had some bugs.... corrected above

    here another version without these delayed calls
    it is better to use the lookto() done calls

  • Quote

    Where can I find information on this type of code on the web. I would like to study more in depth.

    here: https://krpano.com/home/
    but mostly
    here: https://krpano.com/docu/xml/
    and
    here: https://krpano.com/forum/wbb/index.php?l=2

    *g*
    Tuur *thumbsup*

  • i forgot to remove the autorun="onstart" :)


    I realized, it was the first thing I removed, thanks.

    Tuur Thanks
    Those links are the first ones I visit to make inquiries. but in the case of this code supplied by indexofrefraction, I was querying about local.smt and local.off, but got no results. is why I was encouraged to ask for help to obtain other sources

    Edited once, last by ramirox3 (August 29, 2020 at 1:51 AM).

  • Hi,

    'local' is an action scope parameter.
    See here: https://krpano.com/docu/xml/#action.scope

    The off and smt etc are variables Index creates in his firstlines.
    You could easily change to local.pub or so *g*.
    You might find some locals in the vtourskin or other krpano example codes..

    Tuur *thumbsup*

Participate now!

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