Skip to content
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

Scale for OrthographicProjection #308

Closed
ahfuckme opened this issue Aug 23, 2020 · 2 comments
Closed

Scale for OrthographicProjection #308

ahfuckme opened this issue Aug 23, 2020 · 2 comments
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Comments

@ahfuckme
Copy link

Right now, the OrthographicProjection seems to have the units in pixels, which makes any 3d renders very small compared to the same render using PerspectiveProjection. Perhaps there should be a Scale field added to the OrthographicProjection and used here to allow one to shrink the very wide field of view.

@GabCampbell GabCampbell added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen labels Aug 23, 2020
@jpetkau
Copy link
Contributor

jpetkau commented Aug 30, 2020

Just ran into this too. It will use a scale attached to the entity, and Camera2dComponents adds a uniform scale, but since it's a uniform scale it scales in XYZ, which messes up the depth (in a 2D game, if scale <1.0, then sprites don't draw at all because they're outside of zmin..zmax).

At minimum it needs a nonuniform scale, which means you can't use Camera2dComponents (or you need to manually remove the uniform scale that it creates.)

Ideally I think OrthographicProjection should replace window_origin with a more explicit enum that covers more options, something like:

  • pixels with (0,0) in lower-left, Y up
  • pixels with (0,0) in top-left, Y down
  • pixels with (0,0) at center, Y up
  • H units tall and/or W units wide, with different aspect ratios handled as:
    (1) H exact, adjust W to preserve aspect ratio
    (2) W exact, adjust H to preserve aspect ratio
    (3) minimum of (1) or (2)
    (4) maximum of (1) or (2)
    (5) exactly H*W, so don't preserve 1:1 aspect ratio

@alice-i-cecile
Copy link
Member

I believe this was solved by #400 getting merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

4 participants