You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it is right now, the axis of rotation has a slight mis-alignment, which grows larger with faster rotations.
Also, Axis angle should use atan2 instead acos2, to prevent possibility of singularities when standing still:
axisAngle=function(rotation){//NOTE: Index = 3*row + col when basis vector varaxis=[rotation[5]-rotation[7],rotation[6]-rotation[2],rotation[1]-rotation[3]];varsin=Leap.vec3.len(axis);varcos=((rotation[0]+rotation[4]+rotation[8])-1.0)*0.5;varangle=Math.atan2(sin,cos);if(-1e-6<sin&&sin<1e-6){axis=[0,0,0];angle=0;return[axis,angle];}Leap.vec3.scale(axis,axis,1/sin);return[axis,angle];}
where rotation is defined by
https://github.com/leapmotion/leapjs/blob/master/lib/hand.js#L278-L282
As it is right now, the axis of rotation has a slight mis-alignment, which grows larger with faster rotations.
Also, Axis angle should use
atan2
insteadacos2
, to prevent possibility of singularities when standing still:cc @GabrielHare
PS: full fiddle is here: http://jsfiddle.net/kLs8ymye/2/
The text was updated successfully, but these errors were encountered: