Repository navigation
Resolve Z units to meters - #3509
Merged
Merged
Conversation
added 2 commits
November 1, 2016 12:04
… future other 3D types)
ansis
reviewed
Nov 1, 2016
| mat4.translate(m, m, [-this.x, -this.y, 0]); | ||
| mat4.scale(m, m, [1, 1, | ||
| // scale vertically to meters per pixel (inverse of ground resolution) | ||
| (Math.pow(2, this.zoom) * 512) / (2 * Math.PI * 6378137 * Math.abs(Math.cos(this.center.lat * (Math.PI / 180)))), |
Contributor
There was a problem hiding this comment.
Can you document or split this up a bit more? maybe replace 2 * Math.PI * 6378137 with a circumferenceOfEarth constant
Contributor
|
This looks good. Have you checked this visually? If you make a cube from real-world distances does it get rendered as a cube?
yeah, I think so |
Contributor
Author
|
@ansis yep |
lbud
pushed a commit
that referenced
this pull request
Nov 1, 2016
* Resolve Z units to meters (and move z scaling to transform for use in future other 3D types) Fixes #3385.
lbud
pushed a commit
that referenced
this pull request
Nov 1, 2016
* Resolve Z units to meters (and move z scaling to transform for use in future other 3D types) Fixes #3385.
lbud
pushed a commit
that referenced
this pull request
Nov 2, 2016
* Resolve Z units to meters (and move z scaling to transform for use in future other 3D types) Fixes #3385.
lbud
pushed a commit
that referenced
this pull request
Nov 2, 2016
* Eliminate fill-extrude-{height,base} in favor of separate fill-extrusion type
* Resolve Z units to meters (#3509)
12 tasks done
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Fixes #3385.
I branched off the fill extrusion separate type branch and would like to merge this back into there. Lint tests are passing because of the new ESLint formatting — @mourner fixed this on master. I'd like to merge this (not passing) into the fill-extrusion-type branch and then just rebase once there.
My question is this: this line is affected when the map bearing is non-zero. Then here I'm introducing a z scaling in the same matrix. Effectively this means there is a single test in map.test.js failing here, as
— before
toFixedthat number is something like -2-13, so it introduces a miniscule change. That's the only test that fails, and all non-extrusion render tests pass; is it okay to just update this test to parse/round a bit differently to make this test pass? Or should the matrix scaling happen elsewhere/will there be unintended consequences of scaling here (after therotateZ)?@ansis @jfirebaugh @lucaswoj