Multitouch in VE3D

Ever since I got a Touchsmart at home I've been very interested in the desktop touch experience, and so in the last couple days I decided to play with how I could incorporate it into VE3D.  The code itself isn't really ready for consumption, but if you'd like to see where I'm at, I've built a very preliminary plug-in that you can install and play with.

Download

This requires Windows 7 and a machine that has multitouch support, such as a Touchsmart or Latitude XT.  The package is a self-extracting zip, just run it and accept the defaults.  The next time you launch VE3D, the plug-in will load shortly after startup.  There's no UI or anything.  The gestures will just quietly start working.  The plug-in will work on any app that uses GlobeControl (and loads it), but since it calls native code it does require installation.

Currently supported are two-finger zoom and two-finger rotate.  I'm using the built-in gesture engine from Win7, which makes things very easy, but in the future I would like to use direct touch input instead.  This should eliminate a few artifacts like a momentary delay between when you start input and when the map starts moving.  It should also allow support of some more interesting types of inputs, like a two-finger pan, combining rotate and zoom into a single fluid motion, etc.  The point is that there's a lot of potential beyond what I've done here.

The touch interface in Win7 relies on Windows Messages and a few native functions.  To listen to Windows Messages, use Host.CommunicationManager.AttachToMessage.  To interact with the native gesture API, here's something to get you started (this code will work just as well in any managed application).  After that it's a matter of redirecting gestures to existing navigation Actions using bindings.  To really do it right you'd probably also want to write a few things in your own CameraController.

Here's the gesture documentation on MSDN.  Here's the raw touch docs.

Note:  there's a bug in the current GlobeControl where the lParam and wParam values are reversed in the handler to AttachToMessage.  Whoops!  This is fixed in the next version, so be prepared.  I will be releasing my code as a sample at that time, and will update the installer as well.

Note 2:  I noticed on my Touchsmart that the rotate gesture has some trouble when your fingers are diagonal relative to the screen.  I think this is a driver thing, since it doesn't happen on the Latitude XT, which uses a different touch technology and, obviously, different drivers.  However, it looks like they are releasing improved drivers on Windows Update, so I hope this is just a bleeding edge thing.

Edit:  the "Download" link has been updated to a version that is compatible with the current build on Virtual Earth 3D.  Please uninstall the old version first and then install the new one.  Functionality is still the same, that is to say, less than ideal.  From what I have seen, using WM_TOUCH instead of WM_GESTURE will provide a far superior experience.  Stay tuned.