function LMHandPos1(%x, %y, %z) { // Output the absolute position of the first hand to the console: echo("Hand 1 position in millimeters:" SPC %x SPC %y SPC %z); } function LMHandRot1(%x, %y, %z, %a) { // Output the absolute rotation of the first hand to the console: echo("Hand 1 rotation as angled axis:" SPC %x SPC %y SPC %z SPC %a); // Convert into a world space forward vector %pos = "0 0 0"; %rot = %x SPC %y SPC %z SPC %a; %transform = MatrixCreate( %pos, %rot ); %forward = MatrixMulVector( %transform, "0 1 0" ); echo("Hand 1 world forward vector:" SPC %forward.x SPC %forward.y SPC %forward.z); } $LeapMotion::GenerateIndividualEvents = true; moveMap.bind( leapmotion, lm_hand1, LMHandPos1); moveMap.bind( leapmotion, lm_hand1rot, LMHandRot1);