title: movement of the rotated camera relative to space
body: <p>I am using react-three.
  I want to bind the camera to the player's position and I want to rotate the camera, but then the camera moves along its coordinate system (rotated), I want its position to change in the world coordinate system. How can I do it? Camera position also depends on fov.</p>
  <pre class="lang-js prettyprint-override"><code>export const Player = React.memo((props) =&gt; {
  
    const {camera} = useThree()
    const mesh = useRef()
    const [fov, setFov] = useState(100)
  
    const distance = 5;
  
    useFrame(() =&gt; {
      camera.near = (1 / camera.fov) * 10
      camera.far=10000
      let init_depht_s = Math.tan(75 / 2.0 * Math.PI / 180.0) * 2.0;
      let current_depht_s = Math.tan(camera.fov / 2.0 * Math.PI / 180.0) * 2.0;
      camera.position.set(
        (mesh.current.position.x + ((mesh.current.position.x - distance)*-1)) * init_depht_s / current_depht_s,
        (mesh.current.position.y + ((mesh.current.position.y - distance)*-1)) * init_depht_s / current_depht_s,
        (mesh.current.position.z + distance) * init_depht_s / current_depht_s
      )
      camera.fov = fov
      
      camera.lookAt(mesh.current.position)
  
      camera.updateMatrixWorld()
      camera.updateProjectionMatrix()
    })
  
    return &lt;mesh
      {...props}
      ref={mesh}
      scale={1}
      rotation={new Euler((0).toRad(), (0).toRad(), (0).toRad())}
    &gt;
      &lt;boxGeometry args={[1, 1, 1]}/&gt;
      &lt;meshStandardMaterial color={`hsl(0,100%,50%)`}/&gt;
    &lt;/mesh&gt;
  })
  </code></pre>