How do you lock the camera from translating but have freelook ?


I would like to have a camera LOCKED at a position, but allow to rotate in any direction. like if I am in the center of a ball, and be able to look all around me while remaining in the center of the ball

I tried to play with the screenSpaceCameraController BUT :

    // I do not want translate so
    screenSpaceCameraController.enableTranslate = false;

    This partially works, If I grab the sky and drag, it rotate and my position do not move, but if I grab the earth and drag I am still able to move around.

   // do not allow to grab the world and translate on rotation
   screenSpaceCameraController.enableRotate = false;

   but also disable the rotation, so is useless...

The other parameters are unrelated.

Am I missing something ?

The easiest way to do this is to change the camera’s reference frame. Here’s a code example showing how to set it to a position on a line so you can orbit the camera around the line easily. Let me know if that helps!