Hotspot hlookat - vlookat problem

  • I am using 1.16.4 version now. In 1.0.8 version it was
    possible to add hlookat="" vlookat="" parameters to
    hotspots to be able to start whereever I want in the next scene like this:

    <hotspot name="liv" ath="193"
    atv="7" style="_hotspot_ani"

    icon_type="arrow"
    toscene="restaurant" hlookat="80" vlookat="0"


    fov="120"/>

    But in 1.16.4 version, the code is like this:


    <hotspot name="spot1"
    style="skin_hotspotstyle" ath="97.536"


    atv="6.633" linkedscene="restaurant"
    />

    As you know there are no hlookat=""
    vlookat="" parameters. I included them manually but it did not work.

    Going in a street from one point to another point in one
    direction it is OK. But, coming back to the start point using hotspots is a
    problem. While coming back, our face must look at the opposite direction.


    I think there must be a way to solve the problem. I could
    not find an answer in the forum.

    Thank you in advance.
    Best Regards,
    Engin Yarbasan

    Einmal editiert, zuletzt von xinttr (8. Juli 2013 um 11:17)

  • Hi to all of you! *tongue*

    I've just played with it and got it working, although via some tricky way, but anyway it seems to work.
    I based my code on the loadscene(); action where one must state the variables of the loaded pano.

    See documentation here:
    http://www.krpano.com/docu/actions/#loadscene

    These parameters are separated by '&' sign in Flash and "&amp;" in html5. And I found out that

    Code
    loadcene(scene2,view.hlookat=get(hotspot[get(name)].hlookat)& view.vlookat=get(hotspot[get(name)].vlookat), MERGE, BLEND(2));"

    doesn't work, I suppose because these 'vars' flags don't support dynamic retrieving of the variable.

    So i went the other way: when mouse goes over the hotspot, there's a variable created via txtadd(); action and this variable contains all the data required for loading of the next pano( including those 'hlookat' and 'vlookat' parameters added by get(); action). Then the hotspot's onclick is changed to the "hs_onclick" built by the txtadd(); action.

    I have hotspots with uniform style:

    Code
    <style name="hotspots"
    	width="27" height="27" keep="false" enabled="true"
    	crop="0|0|27|27" onovercrop="0|27|27|27" ondowncrop="0|54|27|27" scale="1" alpha="1.0" zoom="false" 
    	onhover="showtext('get(hotspot[get(name)].tooltip)');"
    	onover="txtadd(hs_onclick, 'lookto(get(hotspot[get(name)].ath),0,50,tween(easeInSine,2),true,false);wait(0.1);if(device.flash, 
     loadscene(get(linkedscene),view.hlookat=','get(hotspot[get(name)].hlookat)','&view.vlookat=','get(hotspot[get(name)].vlookat)',',MERGE,ZOOMBLEND(2,3)); , loadscene(get(linkedscene),view.hlookat=','get(hotspot(get(name)).hlookat)','&amp;view.vlookat=get(hotspot(get(name)).vlookat),MERGE,BLEND(2)););');
    	set(onclick, 'get(hs_onclick)');"
    	onout="action(autoRotateReturn);hide_tooltip();"
    	/>

    And hotspots themselves are:

    Code
    <hotspot name="hs_test" style="hotspots"
    	  url="%SWFPATH%/hotspots/left.png" linkedscene="villa_elena_k"
    	  ath="0" atv="0" 
          hlookat="90" vlookat="0"	  
    	  tooltip="Go to the pano with predefined view parameters"
    	/>

    Try this code, I suppose it should work fine *tongue*


    Hope this helps!

  • Well, just change the "onover" to "onloaded" *tongue* so that it doesn't matter whether it's Flash or html5...

    Code
    <style name="hotspots"
    	width="27" height="27" keep="false" enabled="true"
    	crop="0|0|27|27" onovercrop="0|27|27|27" ondowncrop="0|54|27|27" scale="1" alpha="1.0" zoom="false" 
    	onhover="showtext('get(hotspot[get(name)].tooltip)');"
    	onloaded="txtadd(hs_onclick, 'lookto(get(hotspot[get(name)].ath),0,50,tween(easeInSine,2),true,false);wait(0.1);if(device.flash, 
     loadscene(get(linkedscene),view.hlookat=','get(hotspot[get(name)].hlookat)','&view.vlookat=','get(hotspot[get(name)].vlookat)',',MERGE,ZOOMBLEND(2,3)); , loadscene(get(linkedscene),view.hlookat=','get(hotspot(get(name)).hlookat)','&amp;view.vlookat=get(hotspot(get(name)).vlookat),MERGE,BLEND(2)););');
    	set(onclick, 'get(hs_onclick)');"
    	onout="action(autoRotateReturn);hide_tooltip();"
    	/>

    Please, give me any feedback if this helped or not *smile*

  • If this code works fine, then there's one issue left - to integrate it into the standard hotspot style used by default in the droplets. Or adjust this style after the xml was generated. I never used the standard skin, but I think such integrating won't be a great trouble...

  • Hi,

    I would recommend a way like this:

    1. load the load the scene with the loadscene() action
    2. then set the view direction with the lookat() action (or set it via set(view.hlookat,...)

    e.g.

    Code
    <hotspot (or style) ...
      ...
      hlookat="..."
      vlookat="..."
      ...
      onclick="...; loadscene(...); lookat(get(hlookat),get(vlookat)); ... ";
      ...
      />

    Best regards,
    Klaus

  • Hi,

    I would recommend a way like this:

    Thanks a lot, Klaus!
    Please, can you provide the code "if" for vtourskin.xml?
    I put your code into vtourskin like this:

    Code
    <style name="skin_hotspotstyle" url="vtourskin_hotspot.png" scale="0.5" edge="top" oy="0"
    	       distorted="true"
    	       onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); lookat(get(hlookat),get(vlookat)); skin_updatescroll(); );"
    	       onhover="if(skin_settings.tooltips_hotspots, if(linkedscene, showtext(get(scene[get(linkedscene)].title),SKIN_TOOLTIPS)) );"
    	       onover="autoRotateSave"
    		   onout="autoRotateReturn"
    		   />


    And now i can add hlookat and vlookat to any hotspot i want, but the problem is now, that if i don't add hlookat vlookat to hotspot, it wouldn't load the pano with "set as startup view" settings, but will give me a black screen...


    Thanks a lot! =)

  • Hi,

    try:
    onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); if(hlookat !== null, lookat(get(hlookat),get(vlookat)); ); skin_updatescroll(); );"

    Best regards,
    Klaus

  • try:
    onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); if(hlookat !== null, lookat(get(hlookat),get(vlookat)); ); skin_updatescroll(); );"

    Hi, Klaus.
    This code works in version 1.18, but it is not working in version 1.19-pr10. What could be the reason?

  • Fallbeispiel:
    Blick der Startszene zum nächsten Hotspot; Klick auf Hotspot, von der Startszene ausgegangen -> zum zweiten Hotspot gerade aus
    Blick der Zweiten Szene zum nächsten Hotspot; Klick auf Hotspot, von der zweiten Szene ausgegangen -> zum dritten Hotspot gerade aus
    Blick der dritten Szene quasi umgedreht zum zweiten Hotspot, Klick auf Hotspot, bon der dritten Szene ausgegangen -> zum zweiten Hotspot gerade aus
    !!! Jetzt soll der blick nicht zum dritten hotspot wieder sein, sondern auf den Startszenen hotspot sein. also sich nicht wieder umdrehen zum letzten punkt !!!

    Hab auch ne kleine Skizze gemacht :D

    Vielen Dank für eure Hilfe!

    LG Anjenehm

  • Hi,

    this is quite simple.

    Code
    <action name="Move">
    	loadscene(%1, null,MERGE,ZOOMBLEND(0.5));
    	lookat(%2,%3,%4); <!-- hlookat,vlookat,fov -->
    </action>


    I made you a quick example.
    http://virtualtuur.com/krpano/return/1/

    xml: http://virtualtuur.com/krpano/return/1/tour.xml
    Can be smarter, more extended etc of course..


    Hope it helps
    tuur *thumbsup*

Jetzt mitmachen!

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