Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tsherif committed Sep 30, 2019
1 parent f211083 commit b8147a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev-docs/RFCs/v8.0/coordinate-spaces-rfc.md
Expand Up @@ -36,5 +36,5 @@ and removing -y scaling in the initialization of the view matrix in [viewport.js

The issue of scaling the z-axis is also easily resolved by removing [that scaling](https://github.com/uber-common/viewport-mercator-project/blob/master/src/web-mercator-utils.js#L195) from the view matrix calculation and adjusting the [near and far planes](https://github.com/uber-common/viewport-mercator-project/blob/master/src/web-mercator-utils.js#L236-L237) accordingly.

Removing the zoom from common space is slightly more complex in that it might affect the use case of sharing a context with Mapbox. The simplest and most intuitive approach would be to apply zoom as a scaling of the z component of the view space translation, i.e. dividing the z component of [this translation](https://github.com/uber-common/viewport-mercator-project/blob/master/src/web-mercator-utils.js#L191) by the mercator scale (2<sup>zoom</sup>). This produces the zoom effect by moving the camera closer to the map surface. The issue that arrises in the case where a depth buffer is being shared with Mapbox is that the depth values will no longer match, since they'll be relative to different near/far planes. It should be straightforward, however, to map the depth values to each other in the shader when required using the two sets of near/far planes as input. It might also be worth considering, given that this (and the removing the y-flip) would move common space away from the standard web mercator projection, whether it would be worthwhile to change the units used to meters. This would remove the need to convert meters to pixels and vice-versa, and would move common space closer to allignement with the WGS84 standard.
Removing the zoom from common space is slightly more complex in that it might affect the use case of sharing a context with Mapbox. The simplest and most intuitive approach would be to apply zoom as a scaling of the z component of the view space translation, i.e. dividing the z component of [this translation](https://github.com/uber-common/viewport-mercator-project/blob/master/src/web-mercator-utils.js#L191) by the mercator scale (2<sup>zoom</sup>). This produces the zoom effect by moving the camera closer to the map surface. The issue that arrises in the case where a depth buffer is being shared with Mapbox is that the depth values will no longer match, since they'll be relative to different near/far planes. It should be straightforward, however, to map the depth values to each other in the shader when required using the two sets of near/far planes as input. It might also be worth considering, given that this (and the removing the y-flip) would move common space away from the standard web mercator projection, whether it would be worthwhile to change the units used to meters. This would remove the need to convert meters to pixels and vice-versa, and would move common space closer to alignment with the WGS84 standard.

0 comments on commit b8147a1

Please sign in to comment.