- Home /
Need advice on custom finger gesture recognition
hi, im fairly new to unity and need some advice. I am creating a program where I need the to create custom finger gestures. I looked at fingergestures in the asset store, however it seems to be for making regular gestures (swipe, pinch etc) easier to deal with. I want to make my program reconize specific one finger gestures assigned by me. for example I want my program to be able to tell if a user used their finger to input a circle or a small letter e. any help would be appreciated. Thanks
I really hope you get an answer, but unfortunately there is little to no information on this. I have been working on my own custom gestures, and this was the only thing I found. I didn't download the zip as I assume it's for xCode (iOS), but ins$$anonymous$$d followed the basic description of the algorithm, well the touch position logging stuff then I jumped straight to 3 (check total number of points, if < 12, not a circle) : http://iphonedevelopment.blogspot.com.au/2009/04/detecting-circle-gesture.html
So far I can detect a circle and a straight line. $$anonymous$$y square is getting there, but at the moment it has to be drawn parallel to the screen. Basically for the type of gestures you are looking for, you have to work out the logic and code it yourself.
One last thing I recently saw and bookmarked was for a 2-finger scroll : http://answers.unity3d.com/questions/406598/two-finger-scroll-gesture-recognizing-on-iphone.html
I haven't tried working with it myself, but there's a liberally licensed c# library called "$1 Recognizer" that might be what you're looking for: http://depts.washington.edu/aimgroup/proj/dollar/
It has a pretty impressive browser-based demo as well!
Perhaps this tutorial/course may be helpful, if you interested in learning how to make a pattern recognizer from scratch but don't know where to start:
ZoomDomain I got excited when I saw these links, however your first one is just an unanswered question (by Heisenbug, who we are very happy to have as a member here too!). But you have shown some search strings which I didn't think of, so that's handy, thankyou. The links provided by Philipp and jbarba_ballytech look very interesting, so glad that all of you could share some resources to help learn the secrets of the algorythms for detecting complex gestures. Oo, I havn't searched that one either! .... Ok so now that search string has revealed $recognizer which I hadn't heard of until Philipps comment. Looks like that's the place to start, thanks.
Answer by michellejean · Mar 27, 2013 at 04:01 PM
Hi everyone. thanks for your all your help and advice. I went through all of the links given and I ended up using $P recognizer which is a more recent version of $dollar recognizer. I was able to implement this into my program and it is working quite well. Here is the link http://depts.washington.edu/aimgroup/proj/dollar/pdollar.html
I was able to take the sample c# script provided and adapt it to my program without too much trouble. It says the code is for .net 4.0 however the only parts of the code requiring .net 4.0 are the parts of the sample program which does user input/forms/gui ect. The actual part of the program which does calculations works fine with unity. I just had to make my gesture templates and user input into classes $p could work with.
So in short, this is possible using $p and the results have been good for the project I am making :)
Any chance you could share a bare-bones version of this implementation? I'm in a similar situation myself.
Check this source code files (InputGestures.cs for reading current gesture points (touch/mouse) & DataGestures.cs for reading prevously saved gestures X$$anonymous$$L files (need to put it to "Assets/Resources/TextData/GestureSet") & analyzing current gesture. For using PDollar library just copy 4 files (Geometry.cs, Gesture.cs, Point.cs & PointCloudRecognizer.cs) to project, no need in DLLs.