Can someone please explain the math behind converting a direction-vector or lookAt-vector into a quaternion rotation?
What I am trying to do? I am trying to create a custom aim-constraint for a DCC (Maya. Also, Maya already provides one but I have reason to write a custom one). I have the world-space positions of eye and destination using which I can calculate direction vector but I need to calculate quaternion/euler rotation to rotate the object so that I can look at the destination.
What I found so far? There are couple of thread I found and read so far but some provide engine based approach, some do not provide explanation of math behind it and a few didn't work when converted into code. I am listing few of them here (for reference)
What I am Not looking for?
- way of calculating quaternion rotation from a (transformation) matrix.
- engine based approach eg: