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]: ProjectionSystem should clear projectionMatrix #6739
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The projection-system should produce a matrix that converts world-space coordinates into clip-space coordinates. The sourceFrame is the rectangle in the scene-graph (or world) we want to render. It can also be thought of the "screen" in world-space coordinates. The clip-space rectangle is always x = -1, 1; y = -1, 1. The destination frame is just another word for the viewport - the screen rectangle inside the canvas.
…i.js into fix/projection-system
Co-authored-by: Matt Karl <matt@mattkarl.com>
Codecov Report
@@ Coverage Diff @@
## dev #6739 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 671 671
=========================================
Hits 671 671 Continue to review full report at Codecov.
|
bigtimebuddy
approved these changes
Jul 2, 2020
ivanpopelyshev
approved these changes
Jul 2, 2020
bigtimebuddy
added
the
✅ Ready To Merge
Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
label
Jul 3, 2020
bigtimebuddy
pushed a commit
that referenced
this pull request
Jul 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
✅ Ready To Merge
Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://github.com/pixijs/pixi.js/blob/a4c1e3d58159138f99e2714c476360932ebf0152/packages/core/src/projection/ProjectionSystem.ts#L115
Commenting out
pm.identity()
was a mistake. The underlying assumption was that we were setting a, d, tx, and ty always; and that b, d would always stay 0.However, that assumption is false if the user sets a custom
projection.transform
. If set transform has a non-zero b, d value, then prepending it to the projection-matrix changes the b, d values on it as well.Demonstration
https://codepen.io/sukantpal/pen/ZEQvKBB?editors=1010
Go to line-43, where I am manually clearing the projection-matrix via
renderer.projection.projectionMatrix.identity()
and comment it out. The demo message would gradually become larger & larger with no bounds.