Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a touch display. As input I can receive the coordinates and how many touch points are in use, basically I just get an X,Y couple for every touch event/activated point at a customizable rate.

I need to start from this and build my own callback system to achieve something like Object.onUp().doSomething() meaning that I would like to abstract just the detection of some particular movements and not having to deal with raw data: what algorithms can be useful in this case? What statements? Is there some C++ library that I can dissect to get some useful info?

Would you suggest the use of an heuristic algorithm?

share|improve this question

closed as off topic by doppelgreener, Josh Petrie, Byte56, Trevor Powell, Nate Nov 9 '12 at 18:42

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Since this deals more directly with coding in general, you may want to ask on Stack Overflow instead. However, they prefer it if you have some code/research done beforehand. – Orin MacGregor Oct 10 '12 at 20:24

Touch screens are not inherently more difficult than mice or keyboards. Heuristics are not required in any sense. It's just a matter of comparing data from one tick to the next.

Simply maintain a structure to hold the previous raw data. Each frame, store the last frame's data into it, and then fetch new data. An up event is the former presence of a touch datum while the current frame lacks it. Motion is simply the current touch position minus the first.

Using those determinations, you can build up higher order functions like detection of gestures, multitouch patterns, etc.

Don't overthink it just because it's a touch screen. :)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.