Set lookat value for next scene from current scene hotspot (please help!)

  • Hello,

    I'm using latest version (119pr15) and trying to link from Scene A to Scene B by clicking a hotspot that located in Scene A

    The thing is the default view of scene B is WEST, but I need to change the "lookat" value to show it at NORTH direction right after clicking the hotspot.

    After few days seeking answers here, I tried this way but I doesn't work:

    I added a style in vtourskin.xml:

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


    and here is tour.xml:

    Code
    <hotspot name="spot1" scale="0.40" rotate="30" style="skin_hotspotstyle_quang" ath="-35.241" atv="50.050" linkedscene="scene_s000" lookat="-3.8,90,120,0,0"/>


    but it doesn't work!

    I tried to put the lookat value inside the <style>, for example like this:

    Code
    <style name="skin_hotspotstyle_quang" url="vtourskin_hotspot.png" scale="0.5" edge="top" oy="0"	       distorted="true"	       onclick="loadscene(get(linkedscene),null,MERGE,BLEND(1)); lookat(-3.8,90,120,0,0);"	       onhover="if(skin_settings.tooltips_hotspots, if(linkedscene, showtext(get(scene[get(linkedscene)].title),SKIN_TOOLTIPS)) );"	       onover="autoRotateSave"	  	 onout="autoRotateReturn" />


    so it works, but off course for all hotspot with this style.

    So I think the problem here is at:

    Code
    lookat(get(lookat))


    How should we define "lookat" value correctly to make it works?


    Thank you and sorry for my English explaination.

    Regards!

  • Hi

    You want to download the lookat data from the hotspot, which is no longer in the memory, so this data is gone...

    Check it out:

    Code
    <hotspot name="spot1" ... linkedscene="scene_s000" my_lookat="-3.8,90,120,0,0"/>


    Code
    <style name="skin_hotspotstyle_quang"  onclick="load_scene(get(linkedscene),get(my_lookat));"	... /> 
    
    
    <action name="load_scene" scope="local" args="linkedscene,my_lookat">    
      loadscene(get(linkedscene),null,MERGE,BLEND(1));     
      lookat(get(my_lookat));
    </action>


    I have not tested this code but it should work.


    regards
    Piotr

  • Hi,

    the vtourskin.xml has already a build-in functionality for setting the looking direction for hotspots:

    therefore just add a

    Code
    linkedscene_lookat="H,V,FOV"

    attribute to the <hotspot> (FOV is optional).

    E.g.

    Code
    <hotspot name="spot1" style="skin_hotspotstyle" ... linkedscene="scene2" linkedscene_lookat="90,10" ... />

    Best regards,
    Klaus

  • we should just replace linkedscene_lookat="H,V,FOV" instead of hlookat="0.0" for every scene...
    as just klaus said

    Code
    <view hlookat="0.0" vlookat="0.0" .../>


    to :

    Code
    <view vlookat="0.0" linkedscene_lookat="H,V,FOV"  ... />

    thanks klaus
    but it actually effect on any loadscenes from side menu and others like mapspot
    try this for just wanted loadscene by KEEPVIEW in following code

    example :

    Code
    <scene name="Floor2"  onstart="updateradar();">
    	<action name="updateradar">
    			set(plugin[thumb1].onclick,loadscene(scene_Floor2_sceneL5,null,MERGE|KEEPVIEW,BLEND(0.5)); );
    			set(plugin[thumb2].onclick,loadscene(scene_Floor2_scene5,null,MERGE|KEEPVIEW,BLEND(0.5)); );
    		</action>
    </scen>

Jetzt mitmachen!

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