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!
@ansis any thoughts on this?
I don't think its incorrect, the points you've labelled as centerOffset and center actually overlap. This is a more accurate representation
the cameraToCenterDistance stays the same, because the center doesn't move. The padding options are used to calculate a asymmetric fov, and update the projection matrix accordingly.
@arindam1993 Thanks a lot. I understand.
It took me a long time to understand the meaning of the topHalfSurfaceDistance variable, can you give me some guidance, something like the above picture, thanks a lot.
qq:651303647