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

Monday, January 7th 2019, 11:21am

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:

Source code

1
<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:

Source code

1
<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:

Source code

1
<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:

Source code

1
lookat(get(lookat))




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


Thank you and sorry for my English explaination.

Regards!

This post has been edited 1 times, last edit by "rockable84" (Jan 7th 2019, 11:41am)


spacerywirtualne

Professional

Posts: 958

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Monday, January 7th 2019, 12:53pm

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:

Source code

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



Source code

1
2
3
4
5
6
<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
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

3

Monday, January 7th 2019, 5:43pm

Hi,

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

therefore just add a

Source code

1
linkedscene_lookat="H,V,FOV" 
attribute to the <hotspot> (FOV is optional).

E.g.

Source code

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


Best regards,
Klaus

4

Monday, January 7th 2019, 6:25pm

linkedscene_lookat="H,V,FOV"
Wow you saved my life! Thank you! Wondering why I couldn't find similar answers in previous posts.

Thank you!

5

Tuesday, December 3rd 2019, 7:43am

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

Source code

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

to :

Source code

1
<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 :

Source code

1
2
3
4
5
6
<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> 

This post has been edited 1 times, last edit by "Cestmoimahdi" (Dec 3rd 2019, 8:05am)