hello threejs!
I’ve spent a few hours trying to best to “attach” a camera and orbit controls to a moving object. I have seen a few similar posts, but none seem to work for me.
I imagine the camera and orbit controls, attached to the rocket, will circle a planet and seem as if the rocket is still and the planet is moving too and from the object.
I have the “up” vector with respect to the rocket’s perspective and think the camera should also share this up vector, stay with the object, and maintain orbit controls.
I have tried a few ways, including moving and rotating all the objects in the scene so my rocket stays at world (0,0,0), using a second dummy camera, and attaching the camera to my rocket. None seem to work.
If there is any simplifications for my problem, the rocket and planet will stay in a 2D plane. In the example below, they stay in the ZY plane.
Any help will be greatly appreciated. Thanks!
demo: