I have made a (visual) implementation of your solution (the first one, with the bigger circumscribed invisible cube that always lookAt the camera), and it seems to works pretty well: https://codepen.io/abernier/pen/zYjJwKo?editors=0011
As expected, it remains an issue when the camera is getting close:
I will try to fix this with the apparent diameter formula you pointed out, but I’m not sure to understand what δ
stands for in the formula: I guess the FOV?
I’d like to be able to compute the missing “offset” my top/bottom blue spheres need to “touch” the projected surface.
But I’m not sure about how…
Don’t hesitate to review/fork the pen if you want, I’m not so confident with my code (particularly when I zoom a lot, the computed height is kinda strange, and I don’t know why…)