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 RectangleGeometry texture rotation #4725

Merged
merged 4 commits into from
Dec 7, 2016
Merged

Fix RectangleGeometry texture rotation #4725

merged 4 commits into from
Dec 7, 2016

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Dec 7, 2016

Fixes #2737

Before the texture was being rotated using a texture rotation matrix. This wasn't working because the RectangleGeometry is rotated in Cartographic space (so it remains a rectangle in 2D) and using the matrix to rotate the texture coordinates made them no longer line up with the positions.

To fix this, I compute the rotated texture coordinates based on the angle difference between the texture coordinate rotation and the rectangle rotation.

rotatingrectangle2

@dwhipps
Copy link
Contributor

dwhipps commented Dec 7, 2016

@hpinkos One thing I checked (and want to stress) is that this bug was more/most obvious when the aspect ratio of the rect was bigger (i.e more rectangular, less square.) I did that test and it looks great. Thanks!

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 7, 2016

Amazing!

@hpinkos please update all the issues and/or forum posts about this, thanks!

@pjcozzi pjcozzi merged commit 7e7cd7e into master Dec 7, 2016
@pjcozzi pjcozzi deleted the rectangle-texture branch December 7, 2016 15:09
@juburr
Copy link
Contributor

juburr commented Dec 13, 2016

Thank you!! This was extremely helpful. It works great when I point to master. Will this be part of release 1.29 at the very beginning of January?

@hpinkos
Copy link
Contributor Author

hpinkos commented Dec 13, 2016

@jburr-nc yep! This will be included in 1.29 released on January 2

@bagnell bagnell mentioned this pull request May 4, 2018
10 tasks
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.

Texture rotation incorrect
4 participants