1.Vector
在leap.js中,數學矢量矩陣用的是glmatrix JavaScript庫,在leap.js類庫中包含glmatrix庫,你無需再複製。去這裏看吧:
http://glmatrix.net/docs/2.2.0/
在JavaScript API(矢量和glmatrix庫)中vector是由一個包含3個參數陣列的數字,而不是一個特定的Vector類,
第一參數爲橫座標,第二個是縱座標,最後是Z座標
glmatrix庫定義了包含三維向量函數的命名空間,例如,給定一個運動的hand()對象,你能夠計算出的手的方向和正 常手掌之間的交叉運動
var crossProduct = Leap.vec3.create();
var direction = hand.direction;
var normal = hand.palmNormal;
Leap.vec3.cross(crossProduct, direction, normal);
函數
2.Matrix.net
在leap.js中,數學矩陣用的是glmatrix JavaScript庫,在leap.js類庫中包含glmatrix庫,你無需再複製。去這裏看吧:
http://glmatrix.net/docs/2.2.0/
orm