Recognizing patterns when drawing over the iPhone screen

梦想的初衷 提交于 2020-01-12 03:51:26

问题


I'm trying to write a game where the user can issue commands by drawing certain patterns with his fingers..for example, if he draws a circle, an 'S' letter, an expiral, etc.

I'm already familiar with touch events and I'm capable of reading the coordinates... my problem Is in finding algorithms and information about the recognition of the patterns with some degree of error.... for example, If I'm supposed to detect a circle I should detect it even if the user didn't did a make perfect one.

Any resources in the matter?, thanks !


回答1:


This site demos a very simple, easy to implement gesture recognizer, which they wrote in Javascript. I've implemented it myself in another language, and found it quite easy to deal with. They've got code, and a paper describing the algorithm; everything you could need.




回答2:


The patterns you're referring to are known as "gestures".

This code seems to be what you're looking for.



来源:https://stackoverflow.com/questions/1313484/recognizing-patterns-when-drawing-over-the-iphone-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!