5,567 views 20 comments

Introducing AS3 Multitouch Gesture Demo Application/Utility

On my last project I had to use a gesture to initiate an event. Due to this, I recently started experimenting in creating a simple multitouch version of some gesture engines that are available. I’ve come across three that are already available in AS3 and chose to start with the $1 gesture algorithm http://depts.washington.edu/aimgroup/proj/dollar/. It only seems fitting to start with this one since Andy Wilson of microsoft research (and many multitouch devices) had a hand in it’s development.

 Introducing AS3 Multitouch Gesture Demo Application/Utility

Like most algorithms, this one matches points drawn with a template that’s already stored. After the gesture is finished, it is matched up against templates in the database and given a percentage of how much it matched it’s closest template (from 0-1). One of the coolest things about this engine is that it’s orientation-less. This means, no matter how you’re orientated on the surface it’ll still recognize the gesture.

The main thing I contributed to the already created $1 gesture port was the ability to have multiple simultaneous gestures occurring at once. This means a single user can perform more than one gesture at a time or multiple users can perform their own gestures while someone else is using the device. However, there are flaws with this algorithm that I’m not fond of  that are performance (speed) related. I’ve only tested with up to 4 touches though so if someone can test with more, please let me know how it runs.

Currently, the demo isn’t fully segregated form the core gesture classes and therefore there’s still some work to be done so that the gesture classes can be used without the demo itself. In the meantime, go ahead and test this out and make sure to give some feedback; it also works with the mouse. The demo allows you to draw a gesture and if it matches on in the database, that gesture will ‘light up.’

The tolerance is set at 80% and therefore if a gesture doesn’t match 80% of a template, it’s not recognized. Both the source and swf file are included. To test the demo, just load up the TouchGestureDemo.swf in flashplayer or a web browser.

Stay tuned for more on this as i’ll show the basics for using this in your own projects in case you need help.

Thanks to Tito (Mathieu Vibrel) and the pyMT crew for pointing me in the right direction.

downloads icon Introducing AS3 Multitouch Gesture Demo Application/UtilityMultitouch Gesture Demo
Downloads: 12078
Size: 102.8 kB

Did you enjoy this post?

Comment Below , Follow Me on Twitter , Like Me on Facebook , or Network with Me on Linkedin

  • Vniversum

    hi,
    Shoul this work on an Eclipse plugin? I want to create new gestures

    • http://sethsandler.com/blog Seth Sandler

      It should work on whatever can compile AS3 code. Flash, flash builder, command line, flex, etc.