Forum

Get LEAP Motion Pitch Yaw Roll from Hand DirectionXYZ and NormalXYZ

Hi noders and nodettes,

I’m simply trying to synchronize the leap motion XYZ position and direction with a BOX. I am having problem getting the right ROLL for the transform 3d applied to the box… By using the POLAR node on the Leap’s hand direction I can get what seems like the right PITCH AND YAW and I understand that I just could’ not get the ROLL out of just the one hand direction vector and this is why we have the Leap’s hand normalXYZ. I thought that by putting the Leap’s NormalXYZ into another POLAR node I could then retrieve the correct ROLL from this POLAR node’s “Yaw” output pin, however it doesn’t work! The roll value does not go from -0.5 to 0.5 but from 0 to -0.5 and then 0.5 to 0, I tried mapping the value and using a switch but I just can’t get it to work.

Am I just looking at it the wrong way and should apply a different type of transformation to my box, like quarternion or something like that?

I’m sure that I am missing something simple here as what I am trying to do isn’t hard but I have a feeling my rusty math skills might be at fault here, so I apologize if it is just a math problem rather than node related problem.

Simple patch attached. Wicked, peace.

LEAP_direction2PitchYawRoll (16.6 kB)

here you go: the solution is much more simple use only LookAt Transform like in the attached patch.

leaporientationv4p.v4p (6.7 kB)

1 Like

Thankx microdee that’s exactly what I was after, I knew there was a simple way of doing this! LookAt Node is the solution. Cheers mate, wicked.