I am working with a cuboid (such as THREE.CubeGeometry 1x1x10) and I have a specific goal in mind:
My objective is to position the cuboid at a certain distance from the origin, along the line connecting the origin and a given point
I also want to rotate the cuboid so that it faces towards the origin
I attempted to achieve this by using:
obj.lookAt(new THREE.Vector3(0, 0, 0));
However, this method ended up rotating the object in such a way that its side was facing the origin, rather than its end.
Regarding the first step (calculating a point N units away from the origin along that line), I am unsure where to start. My approach involved normalizing the vector with the point, essentially creating a unit length line from (0, 0, 0) towards the point. To move that point to the desired distance N from the origin, I thought of scaling that vector accordingly. Not sure if my logic is correct...
Edit
In response to a comment claiming how obj.lookAt() should function, here is what I observed and what I actually desire:
The current orientation of the cuboid after setting its position to a specific point and invoking lookAt()
It is worth noting that the side of the object is facing towards the origin (which is not my intention)
What I aim to achieve is for the object to face the point from its end (I believe I am one rotation away from achieving this, but I am uncertain how to calculate that)