Invert the camera movement with orbit controls

Hi,

I’m trying to find a way to invert the OrbitControls, so when you click and move the mouse to the right, I want the camera to go to left.

I have been playing around but I find it difficult to get it working.

Does someone know a tutorial or an example I could use or know how to implement this?

Thank you in advanced

So I found the answer which is very simple, for does who maybe are looking for this solution

const Control = (props:any) => { 
  const { gl, camera, mouse} = useThree()
  const controls = useRef<any>()

  useEffect(() => {
    if (controls.current) {
      controls.current.rotateSpeed = -0.35
    }
  }, [])

  return <OrbitControls ref={controls} args={[camera, gl.domElement]} {...props} />
}

I found it in this video:

setting the rotation speed negative makes it orbit inverted

See also Can I Invert OrbitControls.js drag control? - Questions - three.js forum (threejs.org)

1 Like