How to rotate a nodes in the direction of a specific vector

Hi monkeys,

I faced a mathematical problem in my project that doesn’t sound too complicated at first but I’m not able to solve it for some days now.

I have one vector and a node with its own “direction vector” (own implementation). Now I want to rotate the node with the result that its direction vector equals the given vector.
lookAt() did not do the job for me, because it just rotates a node to a another node by a given upvector, which does not suit my problem.

I’m looking forward for your hints.


You may have to provide more detail. Like, exactly why lookAt( myPos.add( targetDir ), Vector3f.UNIT_Y ) won’t work for you.