I'm struggling with 3D calculations and could really use some assistance.
In my scene, I have a sphere representing the earth and I'm using OrbitControl to "rotate" it (although in reality, OrbitControl rotates the camera).
I need a function, something like rotateUp(rad)
, that can rotate the earth upwards regardless of the camera's position.
The issue I'm facing is that my current rotateUp
function looks like this:
earth.rotation.x -= rad
While this works when the camera is in its initial position, if the camera rotates 180 degrees, the rotateUp
function actually rotates the earth downward.
Does anyone know how to implement this function properly? Thank you!