ReDollar, 在javascript中,手势识别器

分享于 

1分钟阅读

GitHub

  繁體 雙語
a gesture recognizer in javascript
  • 源代码名称:ReDollar
  • 源代码网址:http://www.github.com/finscn/ReDollar
  • ReDollar源代码文档
  • ReDollar源代码下载
  • Git URL:
    git://www.github.com/finscn/ReDollar.git
    Git Clone代码到本地:
    git clone http://www.github.com/finscn/ReDollar
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/finscn/ReDollar
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    ReDollar

    javascript中的手势识别器。

    这是 dollar.js ( http://depts.washington.edu/aimgroup/proj/dollar/dollar.js )的重构版本,所以命名为"re"+"一元"。

    当然,ReDollar更简单更强大。

    简单示例
    
    var dollarOne = new RD.DollarOne();
    
    
    
    //name: string, it's gesture's name
    
    
    //gesturePoints : 2D array, it's gesture's key-points
    
    
    //[ [x1,y1], [x2,y2], [x3,y3],.. . [xN,yN] ]
    
    
    dollarOne.addGesture(name, gesturePoints);
    
    
    
    //userPoints : 2D array, like"gesturePoints".
    
    
    //It's key-point of user's stroke-gesture
    
    
    //matched is mathed gesture or null (no matched)
    
    
    var matched = dollarOne.recognize(userPoints);