Interlude 2

In lesson 2, we used the scaled projected Mercator coordinates as our final position. That worked fine because the canvas was square, but if it weren't the case, like in this interlude, then you'd see unwanted distortion like in the canvas above. To deal with this issue robustly, the transformation step that performs the zooming must take into account the proportions of the canvas it's projecting to, and adjust the transformation accordingly. The next interlude uses the a window-to-viewport transformation.


View the full source.

Back to the index.