Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

dimazz

Anfänger

  • »dimazz« ist der Autor dieses Themas

Beiträge: 4

Wohnort: Saint-Petersburg, Russian Federation

Beruf: Photographer, 3D-designer

  • Nachricht senden

1

Montag, 21. November 2016, 16:00

get variable don't work

I took the old xml (krpano version 1.16) and try to make it work with krpano version 1.19-pr8. All works, except that the variable (viewdir), which I use to determine the view direction is not taken from the hotspot.
What could be the problem ?

Quellcode

1
2
3
4
5
6
7
8
<style name="skin_hotspotstyle" url="img/hotspot.png" scale="0.3" edge="center" oy="0"
	       distorted="true"
	      onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); lookto(get(ath),0);
		   			loadscene(get(linkedscene),null, MERGE ,ZOOMBLEND(1,2)););
					lookat(get(viewdir),0);"
		  onhover="tween(scale,0.35,0.1);"
		  onout="tween(scale,0.3,0.1)"
	       />


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<scene name="scene_01" title="01" onstart="activatespot(point01,79.48)" thumburl="panos/01.tiles/thumb.jpg" lat="" lng="" heading="">

		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/01.tiles/preview.jpg" />

		<image>
			<cube url="panos/01.tiles/pano_%s.jpg" />
			<mobile>
				<cube url="panos/01.tiles/mobile_%s.jpg" />
			</mobile>
		</image>

		<!-- place your scene hotspots here -->
		<hotspot name="spot1" style="skin_hotspotstyle" viewdir="189" ath="-140.654" atv="38.671" linkedscene="scene_02" />
		<hotspot name="spot2" style="skin_hotspotstyle" viewdir="180" ath="-25.030" atv="40.703" linkedscene="scene_13" />

	</scene>

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

2

Dienstag, 22. November 2016, 07:14

Hi)

Try this:

Quellcode

1
lookat(get(hotspot[get(name)].viewdir),0);



Maybe it helps.
Regards,

Alexey

3

Dienstag, 22. November 2016, 07:46

Hi,

this doesn't work (anymore) because after 'loadscene' the hotspot from the previous scene would be already removed (unless it was defined with keep=true) and so that hotspot and its 'viewdir' attribute aren't available anymore.

In older versions this was working because of a bug (a memory leak), there the hotspot wasn't fully removed.

A way to get this working would be getting the 'viewdir' before the loadscene call, e.g. into some temporary variable and then using that variable later instead.

E.g. here an example:

Quellcode

1
2
3
copy(hs_viewdir, viewdir);
loadscene(...);
lookat(get(hs_viewdir),0);"


Btw - have also a look into the vtourskin.xml from the latest version, it has a similar functionality already implemented - there each hotspot could contain a 'linkedscene_lookat' attribute which would define the looking direction for the linked scene.

Best regards,
Klaus

dimazz

Anfänger

  • »dimazz« ist der Autor dieses Themas

Beiträge: 4

Wohnort: Saint-Petersburg, Russian Federation

Beruf: Photographer, 3D-designer

  • Nachricht senden

4

Dienstag, 22. November 2016, 08:27

Klaus, thanks for the detailed response! Now it works.