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, September 29th 2014, 11:04pm

View control of two panos at once?

I've managed to get two panoramas to turn in sync, using the JavaScript Sync example.

I have a Little Planet button that I'd like to make work in the same way: tap in one pano and both change the view settings. (And then the same to return to normal view of course.)

I've looked but I can't see how to nail it. Any suggestions?

Tuur

Sage

Posts: 3,120

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Monday, September 29th 2014, 11:15pm

I was just doing this yesterday, and i liked to use the gyro, for both.
I made an xml with that gyro plugin in it and included that in both pano xml's
So i would think, give one pano the button and let the action be triggered for both.
Gyro example
http://www.virtualtuur.com/krpano/poppy/2/

Hope it helps.

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

3

Tuesday, September 30th 2014, 12:31am

I've tried using different xml files for each and the same xml file for each, but I know that's not what I need to do here. I could be missing something obvious, but how do I get an action to control two different panos?

Or to look at it slightly differently, how do I get a button to trigger an action in each pano? Hmm... this feels like it might be a more fruitful avenue. But I'm still stumped. *huh*

Tuur

Sage

Posts: 3,120

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Tuesday, September 30th 2014, 1:20pm

almost there.

it depends a bit which side you touch..
i thought to be smart with the logo.. but i think i need to place that with javascript and trigger the action from there..

http://www.virtualtuur.com/krpano/poppy/LP/index.html

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Tuur

Sage

Posts: 3,120

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

5

Tuesday, September 30th 2014, 3:03pm

got it

http://www.virtualtuur.com/krpano/poppy/LP2/index.html

click the logo to switch perspective

in the html in the body:

Source code

1
<div id="logo" style="position:fixed; right:0px; bottom: 0px; width: 50px; z-index: 9999; opacity: 1;" ><img border="0" src="../skin/logo.png" alt="logo"  width="50" height="50" onclick="button()" ></div>


and

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<script>
		function button() 
		{
			var krpano1 = document.getElementById("krpanoLeftViewer");
			var krpano2 = document.getElementById("krpanoRightViewer");
			
				krpano1.call( "if(view.stereographic == true, normal();, littleplanet());" )
				krpano2.call( "if(view.stereographic == true, normal();, littleplanet());" )
					
		}

	</script>


and in pano1.xml AND pano2.xml i include the actions.xmlwhich is here
http://www.virtualtuur.com/krpano/poppy/LP2/actions.xml

@Klaus:
Why is the 'limitview' off not working on ipad etc? on desktop it works.
When i do just one pano it also works: http://www.virtualtuur.com/krpano/littleplanet/2/

i tried also this but does not make a difference:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
		function sync_1to2()
		{
			var krpano1 = document.getElementById("krpanoLeftViewer");
			var krpano2 = document.getElementById("krpanoRightViewer");

			krpano2.set("syncother",    false);
			krpano2.set("view.hlookat", krpano1.get("view.hlookat"));
			krpano2.set("view.vlookat", krpano1.get("view.vlookat"));
			krpano2.set("view.fov",     krpano1.get("view.fov"));
			krpano2.set("view.limitview",     krpano1.get("view.limitview"));
			krpano2.set("view.fisheye",     krpano1.get("view.fisheye"));
			krpano2.set("view.fovmax",     krpano1.get("view.fovmax"));
			krpano2.set("view.stereographic",     krpano1.get("view.stereographic"));
			krpano2.set("display.details",     krpano1.get("display.details"));
		}

		function sync_2to1()
		{
			var krpano1 = document.getElementById("krpanoLeftViewer");
			var krpano2 = document.getElementById("krpanoRightViewer");

			krpano1.set("syncother",    false);
			krpano1.set("view.hlookat", krpano2.get("view.hlookat"));
			krpano1.set("view.vlookat", krpano2.get("view.vlookat"));
			krpano1.set("view.fov",     krpano2.get("view.fov"));
			krpano1.set("view.limitview",     krpano2.get("view.limitview"));
			krpano1.set("view.fisheye",     krpano2.get("view.fisheye"));
			krpano1.set("view.fovmax",     krpano2.get("view.fovmax"));
			krpano1.set("view.stereographic",     krpano2.get("view.stereographic"));
			krpano1.set("display.details",     krpano2.get("display.details"));
		}


Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

This post has been edited 2 times, last edit by "Tuur" (Sep 30th 2014, 4:10pm)