This is a little tricky question.
I am working on ad add-on in which the user is able to add text objects that is automatically constrained to the camera using “child of” constraint and positioned correctly. Here is an example with a camera that has 35mm focal length:
Now what I want is to keep that “screen” position and text size the same regardless of what would be the focal length of the camera. If I switch the focal length of the camera, the text would occupy different position (screen space wise) and would appear smaller or bigger (depending on focal length).
Here is an example with focal length changed to 28mm
The text appears to be smaller and moved up in the screen space.
All of that is obviously caused by how optics work and is the correct behavior.
So my question is this:
What would be the formula to calculate text object position and text font size, so regardless of the focal length the text would always appear to have similar size and position in screen space (camera frame)?
How would you guys approach it?
Thank you so much in advance!!!