I am in the process of rotating an arrow on the surface of a planet to align with the direction of its travel. I have the direction vector and the up vector from the surface normal. How can I convert this into a quaternion for the rotation of my arrow? I am using three.js, so any recommended methods they offer that I can implement would be greatly appreciated. Thank you.
https://i.sstatic.net/bkB8P.png
Here is the information I currently have.
var upVector = new THREE.Vector3();
upVector.subVectors( new THREE.Vector3(0,0,0), lastVec );
var dirVector = new THREE.Vector3();
upVector.subVectors( lastVec, destVec );
var sideVector = new THREE.Vector3();
sideVector.crossVectors( dirVector, upVector );
var newUp = new THREE.Vector3();
newUp.crossVectors( dirVector, sideVector );