-
-
Notifications
You must be signed in to change notification settings - Fork 151
fix: camera aspect #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: camera aspect #538
Conversation
* Update orthographic camera aspect when screen size updates * Give user a "manual" flag to keep Tres from updating camera
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @andretchen0. I like the manual
prop, I'm thinking how we could add it to the docs so the users are aware of it.
Maybe we add an entry in https://docs.tresjs.org/advanced/ ? I'm not sure many users will want it. It's pretty niche. Afaik, no one had complained that Tres was controlling the I just don't want to force people to drop Tres because their use case requires controlling the camera. |
I would say you already found it valuable so let's not wait for the community to request it or complain about it, if someone asks, we can direct the user to that documentation. Outside of the scope of this PR, @andretchen0 I'm strongly thinking about adding a cookbook to the docs similar to this https://docs.astro.build/en/recipes/., maybe is a good candidate? |
I'm open to whatever. We've currently got the Lab. Maybe there should be a "tutorials" or "basics" section there? Here's one way R3F is doing that, for comparison. They've got a lot of examples and basics on their "Getting started" page. That's probably a good move, since most newcomers to a project like Tres will want to see what it can do visually. One drawback to the current Lab setup is that there's no way to see the code directly. If we keep the current setup, maybe we add a button to go directly to the particular example on Github, like Three.js examples: ![]() |
@andretchen0 hey buddy, can you confirm me this would not need to update any docs? If not then we can merge it already |
It would potentially break an existing orthographic camera that the user was updating themselves — which was really the only choice, previously. Maybe that needs documentation? |
I hardly think anyone was doing that until now 😂, it's ok then |
I think you're right. Lol |
Problem
Orthographic camera is not getting updates when screen size changes. So the aspect ratio falls out of sync with window size, resulting in squished/stretched images.
Solution
Context
Manual flag in R3F.