-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add support for scale to OrthograpicProjection #322
Conversation
If you used a Vec3, aka |
The issue with that is how would |
I was purely talking about |
I believe you can always flip, scale, rotate by just camera This PR makes it easier by detaching projection from screen size. You could do the same with existing orthographic projection, but you would have to constantly rescale camera |
Sorry I mixed this with other similar PR #400. I think it is better, because you can adjust scale with just |
Thanks I was able to use |
What I just tested horizontal and vertical flipping by setting x or y scaling to -1.0 and there were no issues. Rotation around y should work too |
I've experimented some more with this, and discovered that using a scale does work, thanks to bevy/crates/bevy_render/src/render_graph/nodes/camera_node.rs Lines 120 to 121 in a5f6cb0
However, the actual problem is with the clipping planes. I do think the whole projection scheme could do with some work to fix the clipping issue (see also #400). |
Example:
Before this change, it was impossible to get a larger (or smaller) image from an
OrthographicProjection
- this is what the new example looks like withscale
set to1
(old behaviour):Notes:
The scale could be inverted, but this interpretation also makes sense
Maybe there's a better name than scale - what do other engines call this?
Maybe it could use the
Scale
component - would require passing ascale
parameter toCameraProjection::update
, which would be meaningless forPerspectiveProjection
, unless it effectedfov
somehow