mapbox-gl-js
mapbox-gl-js copied to clipboard
Is calculation of the topHalfSurfaceDistance wrong at 691 line in transform.js?
mapbox-gl-js version: v12.1.0 browser: chrome
source code:
const topHalfSurfaceDistance = Math.sin(fovAboveCenter) * this.cameraToCenterDistance / Math.sin(clamp(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01));
The cameraToCenterDistance should't be used here, because it is not the distance from the camera to [width/2, height/2 + offset.y].
I drew an image:

Is it wrong?
Looking forward to reply!
sorry, commit twice for network delay