WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Mouse events from a cluster client (https://forum.worldviz.com/showthread.php?t=4316)

victorqx 08-03-2012 07:52 AM

Mouse events from a cluster client
 
Hello all,

Is it possible to capture mouse events from a cluster client? I want to involve a Windows 7 tablet with our PowerWall and use the tablet for navigation and interaction. In order to do this I have written a script to use mouse events from the touch screen for navigation. If I run the script on the tablet alone, it works fine. When I run the script in a cluster, the mouse events of the tablet are not registered, only the ones from the cluster master.

How can I resolve this issue? It would be great to use the tablet as a 'remote' of sorts for our Vizard PowerWall!

Kind regards,

Victor

farshizzo 08-03-2012 04:59 PM

Have you considered using the vizhtml module to provide a control interface to the tablet? In this case, the tablet would just use a web browser to connect and communicate with the master machine.

victorqx 08-06-2012 12:27 AM

Hello farshizzo,

I did consider using the vizhtml module, but at the moment I'm using a top projection on the tablet to show a floor plan of the current scene. I like this floor plan quite a bit and assume that it would be quite a lot of work to supply this in the vizhtml module. Therefore I would like to stick with running the Vizard cluster client.

I assume that mouse events are not supported in this manner (otherwise you would have lead me towards a solution :-)), so I'm first going to try to overlay a transparent application for the mouse events and use socket communication to send them to the cluster master. Last resort would be to run the tablet stand-alone from the cluster and synch the viewpoints and scenes myself via sockets (although using the vizcave module makes this so much simpler!)

Regards,

Victor

victorqx 08-07-2012 02:54 AM

For anyone who is interested in the same thing, here's how I got it to work:

I created a small WPF application with a transparant window (in the XAML you can put something like: Background="#01000000" WindowStyle="None" AllowsTransparency="True" WindowState="Maximized" Topmost="True")

This application is then on top of the regular Vizard application and catches all mouse events. These mouse events are sent via UDP packets to the vizard master.

My script in the vizard master receives these packets (using the built in viz.callback(viz.NETWORK_EVENT,onNetwork) network mechanism) The packets (interpreted as a RawNetworkEvent) are then used to call the appropriate methods as if a mouse event was raised.

It was a little tricky to get object selection working, since the regular viz.pick didn't work for me when applied to a mouse position on the tablet. So, instead I used the intersect method based on two positions that I manually calculate based on the current caveorigin and the size of my ortho projection. PM me for more information if you're interested.

Regards,

Victor

farshizzo 08-14-2012 09:01 AM

Quote:

Originally Posted by victorqx (Post 14076)
I did consider using the vizhtml module, but at the moment I'm using a top projection on the tablet to show a floor plan of the current scene. I like this floor plan quite a bit and assume that it would be quite a lot of work to supply this in the vizhtml module. Therefore I would like to stick with running the Vizard cluster client.

Is the floor plan a static image? If so, then it should be straightforward to provide this to the web browser using the HTML image tag.

Quote:

Originally Posted by victorqx (Post 14076)
I assume that mouse events are not supported in this manner (otherwise you would have lead me towards a solution

There is currently limited functionality for handling some keyboard/mouse events from the cluster clients. However, I'm assuming for your application you would need mouse move events, which is currently not supported. This will be added to the next release though.

victorqx 08-14-2012 11:43 PM

Hello farshizzo,

Thanks for you ideas. I ha considered using a html page with a static image, but ran into two things which I didn't like. First is generation of the static image. I wanted something that would run directly in Vizard, so I wouldn't need any additional admin work to do when adding a new scene. Secondly, I think it is useful for a viewer to see the floormap from the perspective of the cave, so if the cave rotates, the floormap will rotate with it. In this manner you could more easily relate the floormap to what you see in the cave (especially useful for large scenes that wouldn't fit on the tablet at once).

These two things combined led me to believe that using a static image as floormap wouldn't be useful enough.

Using Vizard rendering would require mouse move events, since I would like to be able to move objects around when touching the screen. For now I'll stick to my WPF application and wait for the next release!


All times are GMT -7. The time now is 05:02 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC