diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-04-28 16:01:13 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-04-28 18:43:08 +0200 |
| commit | 30b6637fe84813ad7119e92dd49df7e12692c694 (patch) | |
| tree | 324ad07ddf43596cd6ef65e321d7ea297459a9b3 /docs/gestures.txt | |
| parent | 5423ccd321c1c84b0e7736b10b2fe9eeb1833e16 (diff) | |
Document the gesture frame logic
Add some notes on the math of the gesture frame computations.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'docs/gestures.txt')
| -rw-r--r-- | docs/gestures.txt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/docs/gestures.txt b/docs/gestures.txt new file mode 100644 index 0000000..5a1eb45 --- /dev/null +++ b/docs/gestures.txt | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | Introduction | ||
| 2 | ------------ | ||
| 3 | |||
| 4 | This document describes how the gestures are extracted from multi-finger | ||
| 5 | actions. The process is divided into gestural transformations, gesture | ||
| 6 | recognition, and gesture instantiation. | ||
| 7 | |||
| 8 | Gestural Transformations | ||
| 9 | ------------------------ | ||
| 10 | |||
| 11 | All two-finger transformations are extracted. These are all exact, in the | ||
| 12 | sense that continuously transforming the original finger positions, frame | ||
| 13 | per frame, will exactly follow the actual finger positions. | ||
| 14 | |||
| 15 | In addition to two-finger transformations, a global gesture is also | ||
| 16 | extracted. The rotation and scaling is taken from the contact pair with the | ||
| 17 | longest distance between contacts. This approximates the behavior of a | ||
| 18 | region, such that complex transformations could, in principle, be happening | ||
| 19 | inside the region, but at a distance, the transformation will look like it | ||
| 20 | was performed with two fingers. | ||
| 21 | |||
| 22 | At each time step, a gestural transformation is goverened by rotation, | ||
| 23 | scaling and translation. The point around which rotation and scaling is | ||
| 24 | performed is called the pivot. To form as natural gestures as possible, | ||
| 25 | this point always lies within the area formed by the contacts themselves. | ||
| 26 | It is placed at the point which, after rotation and scaling, leaves the | ||
| 27 | transformed contacts as close to the actual positions as possible. The | ||
| 28 | translation, or drag, is always a fraction of the movement of the center | ||
| 29 | point. The fraction is called moveness, and is related to the distance | ||
| 30 | between the pivot and the center point. When the pivot is at the center | ||
| 31 | point, the moveness is one and the drag is the same as the center movement. | ||
| 32 | When the pivot is at one of the contacts, as in rotation around a finger, | ||
| 33 | the moveness is zero, and consequently the drag is zero. The relations | ||
| 34 | between the pivot, the moveness and the drag are detailed in the document | ||
| 35 | pivot.txt. | ||
| 36 | |||
| 37 | Gesture Recognition | ||
| 38 | ------------------- | ||
| 39 | |||
| 40 | Each gestural transformation can give rise to one or several gesture | ||
| 41 | primitives. Based on the rotation, scaling, moveness and drag values, the | ||
| 42 | gesture primitives drag, pinch and rotate are recognized. The onset of a | ||
| 43 | gesture primitive is governed by a threshold and a timeout. Basically, if | ||
| 44 | performed distinctly enough, the gesture will be triggered, and will remain | ||
| 45 | active until a finger is lifted or added. | ||
| 46 | |||
| 47 | Gesture Instantiation | ||
| 48 | --------------------- | ||
| 49 | |||
| 50 | Given a set of detected gesture primitives, only some will trigger actual | ||
| 51 | gesture events. First, the set of available primitives are matched against | ||
| 52 | available listeners. Primitives not listened for are dropped. The remaining | ||
| 53 | set is arranged according to priority. A pointer gesture has lower priority | ||
| 54 | than a two-finger gesture, which has lower priority than a tap, for | ||
| 55 | instance. As long as the gesture primitives of higher priority are expected | ||
| 56 | but not activated, all gestures are held back. Once one of the highest | ||
| 57 | priority primitives are activated, all primitives of lower priority are | ||
| 58 | cancelled, and events are emitted. | ||
