Skip to content

Resizing container with orthographic camera doesn't scale the scene #2867

Answered by g-rauhoeft
g-rauhoeft asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by g-rauhoeft
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