I have a maybe tricky question to solve. Maybe it's not tricky at all and there is a simple solution that I don't know.
I have a geo that randomly changes its x and y size indepentendly. Now my problem is that I want to fit the field of view to those changes by moving the camera (non orthographic) back and forth (just on one axis). In general it is easy to just calculate it if the size change is only in one direction like this:
distance = (focallength) * ( (size of object in y or x) / filmsize +1 )
But what I am struggling with is how to calculate when both are changing…
I was thinking maybe the diameter could help as its composes out of both axis .. how could I get that value?
Would really appreachiate any help!