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

FIX: handle change aspect change when render area is not full window. #1066

Merged

Conversation

theodoregoetz
Copy link
Contributor

@theodoregoetz theodoregoetz commented Jan 10, 2024

Description

When the camera viewport is not the full window, the aspect ratio of the perspective projection matrix needs to be adjusted in the same way as the EllipsoidPerspective case.

Type of change

This is a behavior-changing fix since the aspect ratio was incorrectly calculated when the viewport extent is not exactly the same as the window extent.

How Has This Been Tested?

I have tested within my own framework built on top of VSG. I could include a minimal example, but I feel it is unneccessary because VSG already has the correct code in EllipsoidPerspective. This PR aligns the behavior of Perspective::changeExtent() and EllipsoidPerspective::changeExtent().

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

I have considered the following items, but believe no action needs to be taken

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

When the camera viewport is not the full window, the aspect ratio of the perspective
projection matrix needs to be adjusted in the same was as the Ellipsoid case.
@robertosfield robertosfield merged commit eb36707 into vsg-dev:master Jan 11, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants