I'm currently working on dynamically resizing the FOV value as the screen sizes change in three JS. I have a calculation that seems to work well for any screen size, but I'm unsure about how to determine the distance in FOV. Any suggestions you have would be greatly appreciated.
const distance = 1000;
const diag = Math.sqrt((height * height) + (width * width));
this.camera.fov = Math.atan((diag) / (3 * distance)) * (180 / Math.PI);
If you could provide guidance on how to determine and calculate the distance value dynamically based on the screen size without using fixed ranges, I would be very grateful.