maplibre / maplibre-rs

Experimental Maps for Web, Mobile and Desktop
Apache License 2.0
1.34k stars 77 forks source link

Transform improvements #233

Closed maxammann closed 1 year ago

maxammann commented 1 year ago

Implements perspective transforms like in maplibre-gl-js

This fundamentally reworks how the far distance plane is calculated. First I wanted to implement it like in maplibre-gl-js. Though that appraoch did not allow yaw AND pitch in both directions. It only allowed pitch in a single direction (only 90°, not the full 180°).

The new approach is dicussed here: https://gamedev.stackexchange.com/questions/207328/calculation-of-far-distance-plane-based-on-yaw-and-pitch-for-a-map-renderer

It works in all directions and should also be way faster to calculate.

This PR also fixes the amount of tiles that are whown for the current zoom. If calculates the appropriate zoom level based on the current zoom and takes into account the resolution of tiles.

nyurik commented 1 year ago

soooooooo happy to see you hacking away on this :)

maxammann commented 1 year ago

soooooooo happy to see you hacking away on this :)

Thanks! :) Yeah need to get this tidied up for EuroRust :D

maxammann commented 1 year ago

These apple executors are barely available :(