React Three Fiber: How Do I Change the Camera Angle?

Currently I have a PerspectiveCamera set up like so:

<Canvas>
  <PerspectiveCamera
    makeDefault
    fov={50}
    position={[0, 0, 80]}
  />
</Canvas>

It seems to be pointing straight into the z direction. I would like the camera to point straight down in the negative y direction. How can I change the angle that it points at?

2

1 Answer

You can add a rotation attribute to the camera same as you added position.

<Canvas>
  <PerspectiveCamera
    makeDefault
    fov={50}
    position={[0, 0, 80]}
    rotation={[x, y, z]}
  />
</Canvas>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest