mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Is calculation of the topHalfSurfaceDistance wrong at 691 line in transform.js?

Open wlfei0502 opened this issue 6 years ago • 1 comments

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:

QQ图片20201004210459

Is it wrong?

Looking forward to reply!

wlfei0502 avatar Oct 05 '20 03:10 wlfei0502

sorry, commit twice for network delay

wlfei0502 avatar Oct 05 '20 03:10 wlfei0502