I've been trying all day to adjust the orientation of a mesh on its Y axis towards a specific location within another mesh.
I've experimented with different methods, but none have yielded successful results so far.
Here is the code I currently have:
var vector = new THREE.Vector3(0,0,5);
var axis = new THREE.Vector3(0, 1, 0);
turret.quaternion.setFromUnitVectors(axis, vector.clone().normalize());
Despite this code, the turret isn't rotating as expected to face the specified vector
position. I also attempted using Euler rotation and vec1.angleTo(vec2)
to manipulate the direction of the turret without success.
If anyone could provide some insight into how this should be working and clarify any misunderstandings I might have, I would greatly appreciate it.