Sie sind nicht angemeldet.

1

Montag, 27. März 2017, 13:34

Controlling pano from another window

Hi,

it's an interesting fact that you can control your pano from another window. That of course requires that you are in an environment where you can show more that one window.



I made this little "remote controller" as a test.

Test page: http://wirestam.com/panos/test/tool/
Zip file: http://wirestam.com/panos/test/tool.zip


/Tommy

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

2

Montag, 27. März 2017, 14:15

Great tool Tommy !!
everpano.com step beyond 360

3

Dienstag, 28. März 2017, 09:17

That´s frickin awesome *thumbsup*

4

Dienstag, 28. März 2017, 10:53

Well, it's the power of a Javascript interface...

Tommy

5

Montag, 3. April 2017, 03:52

좋은 ~, 고마워 ~~

6

Montag, 3. April 2017, 10:20

Zitat

좋은 ~, 고마워 ~~

I agree - eh, I think...

panomaster

Fortgeschrittener

Beiträge: 297

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

7

Montag, 3. April 2017, 12:26

:)

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

8

Montag, 3. April 2017, 16:04

Would be nice to do it from another device ;)
everpano.com step beyond 360

9

Montag, 3. April 2017, 16:59

Hi Jordi,

I gave it some thought earlier, but I'm not an expert at these things. As long as you keep your communication inside the browser, you can use the DOM (or BOM) tree.

But I think as soon as you want to communicate outside the browser, you have to use something like a Web socket. However, these communicate with an URL, so you probably have to go through a web server application - or maybe something like how Internet gaming works.

Tommy

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

10

Mittwoch, 5. April 2017, 11:58

Yes exactlly is about web sockets, just like a chat
everpano.com step beyond 360

11

Donnerstag, 6. April 2017, 09:40

So if I understand that correctly, we could establish a JS-connection between two krpano-instances via websocket?! One instance would send the js-commands to the node.js-server and the other instance receives these commands, just like it does in Tommys example? And just like a simple chat-system the node.js-server could even be used for a two way-communication where the second krpano-instance returns permanently the actual scene-status like ath, atv and fov? *blink*

12

Freitag, 7. April 2017, 02:03

Yes, the two (or several) instances would open a websocket connection to the server application, which only acts as a transfer node between the instances. If all of them are krpano instances, I guess it would be wiser if one is the master and the other slaves - at least if you want to coordinate pano movement.

And you would probably prefer to have an Apache module in your webserver to get quick response, but my own homepage is in a web-hotel, so I don't have that possibility. On the other hand, I run an Apache server in my home PC, but I have forgotten how to write an Apache module.

In the meantime, I made another test page, where you can see that it's possible to control two separate panos with the same remote control:

http://wirestam.com/panos/test/seasons/

13

Freitag, 7. April 2017, 08:49

Great example, Tommy...again *thumbsup*
Would it be possible within your example to control the second pano not with the tool but the ath, atv and fov-values from the first pano?

We really need an websocket/Apache-expert here! This is just to darn good not to be done *g*

14

Freitag, 7. April 2017, 11:30

You can of course always trap all movements in the first pano with the "onviewchange" event, and then send it with javascript to the second pano. But I can't find any way to stop all mouse or keyboard input for moving the second pano directly. I thought I could do it when I found the stopmovements() command, but this only interrupts already ongoing movements. Maybe you can place a transparent <div> over the pano window to prevent any mouse action.

Tommy

15

Freitag, 7. April 2017, 13:04

Just putting a transparent layer above all in the 2nd krpano-instance would be my first choice, because it´s simple and effective! And with the zorder it´s even possible to put some buttons in top of that, to activate or deactivate direct user input. That´s how I de- and reactivate all user inputs after starting the "Autotour" in my virtual tours.