Resizing container with orthographic camera doesn't scale the scene #2867
Answered
by
g-rauhoeft
g-rauhoeft
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
g-rauhoeft
Jun 13, 2023
Replies: 1 comment 1 reply
-
Fixed it. The trick is to set the camera to manual and keep a value for the frustum that is independent of the container size. For anyone interested, here's a working example: https://codesandbox.io/s/elastic-rain-8h9jpw Thanks for the awesome library, pmndrs, you've made my life so much easier. Edit: Also, the drei OrthographicCamera overrides top, bottom, left and right if they aren't passed in as props explicitly. Something to keep in mind if you want to set them imperatively. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
g-rauhoeft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed it. The trick is to set the camera to manual and keep a value for the frustum that is independent of the container size. For anyone interested, here's a working example: https://codesandbox.io/s/elastic-rain-8h9jpw
Thanks for the awesome library, pmndrs, you've made my life so much easier.
Edit: Also, the drei OrthographicCamera overrides top, bottom, left and right if they aren't passed in as props explicitly. Something to keep in mind if you want to set them imperatively.