Hi,
have some problem that bothers me for some time.
I know that from math perspective it will be hard to calculate but I try to find some hacky way to have more or less acceptable result.
I have horizontal cylinder on the screen, and I would like to scale cylinder to fit plane (plane and camera is perpendicular to the screen)
its easy to calculate scale that would fit cylinder size inside rect but because of nature of perspective camera edges of cylinder are going outside react
Any ideas how to calculate scale so it would take into account perspective ? Basically FOV should be taken into account to make sure that cylinder is never outside of allowed rect space.