Skip to content

How can I switch the camera type from Perspective to Orthographic and vice versa on the fly #1377

Answered by drcmda
philxia asked this question in Q&A
Discussion options

You must be logged in to vote

most props on the canvas are one shot initialisations. they're not reactive.

import { PerspectiveCamera, OrthographicCamera } from '@react-three/drei'

<PerspectiveCamera makeDefault={!isOrthographic} />
<OrthographicCamera makeDefault={isOrthographic} />

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@philxia
Comment options

Answer selected by philxia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants