Imagine I have an imaginary axis created by two vectors. For instance, one vector points upwards at x = 10
:
const startingPosition = new Vector3(10, 0, 0)
const endPosition = new Vector3(10, 0, 1)
To find the direction of this axis, you can do the following:
const axisDirection = new Vector3().subVectors(endPosition, startingPosition).normalize()
Now, how do I go about rotating a vector (for example, Vector3(50, 0, 0)
) around this original axis?
I attempted using
Vector3.applyAxisAngle(axisDirection , radians)
, but since the axis was normalized, the rotation occurred around the world center (0, 0) instead of around the initial position of the axis.