Non-centered vertical FOV camera to window offset calculation (trig question)

   1533   1   0
User Avatar
Member
178 posts
Joined: Jan. 2013
Offline
Greetings,
I'm having a “maths” amnesia moment…

Given a camera that is 2048x1536, 0.971 pixel aspect, I need to set the screen window offset so that the FOV is -45.62 - +45.62 degrees horizontal and -35.67 - +40.72 degrees vertical.

What's the trig to calculate the screen window offset, given that the vertical FOV is off-center as described above?

Any “teach me how to fish” advice would be very helpful…

Cheers,
Jon
Edited by jpparkeramnh - Dec. 28, 2016 01:13:00
User Avatar
Member
178 posts
Joined: Jan. 2013
Offline
I think I got it, this seems to work:

sin(-35.67 + 40.72) / 2. / sin(abs(40.72) + abs(-35.67))

generalized to:

sin(neg_vfov + pos_vfov) * 0.5 / sin(abs(neg_fov) + abs(pos_vfov))
Edited by jpparkeramnh - Dec. 28, 2016 21:40:27
  • Quick Links