I have an object that rotates around its axis, I need to rotate this object to a point on the plane, the point is already defined, but I don’t understand how to rotate the object along the Z axis so that it looks clearly towards the point on the plane (to the side other object if it is more convenient)
var mousecoords = this.getMousePos(e);
if (this.turretMesh)
{
var vec = new THREE.Vector3();
var pos = new THREE.Vector3();
vec.set(
( e.clientX / window.innerWidth ) * 2 - 1,
- ( e.clientY / window.innerHeight ) * 2 + 1,
1 );
vec.unproject( this.camera.get() );
vec.sub( this.camera.get().position ).normalize();
var distance = - this.camera.get().position.z / vec.z;
pos.copy( this.camera.get().position ).add( vec.multiplyScalar( distance ) );
this.turretMesh.rotation.z = ????
}