Hi, Just pokng about with this “AR” bringing a hand into Rhino, I bring in the joints as point3d’s from the leap library, then draw the "wires between them, I am trying to bring an object from world origin to a specific finger, using a vector translate, but the “roll” (rotation around Y axis) is quite random and uncontrollable.
I tried three seperate X, Y and Z rotations based on the angles I can pull from the library about the finger XYZ_pitch,roll,yaw, but the Movepitchroll*yaw transform is a tad nuts, ring goes flying all over space.
Vector transform gets me 99% there except that damn roll, any clues on how to work around this?
My current code and some image of the issue, the little ball is Z top.
My current thing is you cant pull a "normal from a vector (i may be wrong) so create a mesh between the two point si do have and the neighbouring two points from the next finger, create a surface/mesh, then pull a normal from that, but how would I apply that normal in my vector equation?
var fingerpointto = (PointsConduit.PointList + PointsConduit.PointList) / 2; //ring finger var translate = fingerpointto - Point3d.Origin; var VectorTo = PointsConduit.PointList - PointsConduit.PointList; var Rotation = Transform.Rotation(Vector3d.YAxis, VectorTo, Point3d.Origin); var Move = Transform.Translation(translate); var TotalTransform = Move * Rotation; e.Display.DrawObject(ring, TotalTransform);