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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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.

You Might Also Like