Vertical FOV and horizontal FOV

Blitz3D Forums/Blitz3D Programming/Vertical FOV and horizontal FOV

Osoko(Posted 2010) [#1]
A Camera

A Panoramic picture which is mapped onto a mesh.

The mesh is a portion of a sphere corresponding to the angle of the pano picture like it is expressed in Autopano

For example for the mesh, we have

Horizontal deg ( - 72° , 72° )
Vertical deg (-36 , 36 )

Ther camera can only rotate and zoom IN/OUT

I want to restrict the rotation possibility of the camera according to the zoom factor.

I'm using CameraFOV = 2* ATan ( 22.67304/Camera\CurrentFocaleMm) ) and CameraZoom Camera, 1.0 / Tan(CameraFOV /2.0) to parse the command

i use Camera\CurrentFocaleMm toset up the cam like a real one ( ex 35mm)



Then if i use a square viewport ( 1024 * 1024 ) , i can control the camera Zoom limite (FOV ) with a simple relation

FOV limit = Camera pitch + CurrentFoV/2 , then if the limite is reached, i can ZoomIn or turn the cam to the center.



My objectif is that the cam don't look the background but can just look into the picture, according it's zooming and rotation possibilities.

When i'm changing the aspect ratio of the viewport, i can't retrieve a formula.


Have you any solution ?


jfk EO-11110(Posted 2010) [#2]
There may be a sophisticated Formula to do that, I however don't know it :). I would take the two (min and max) zoom levels, then note the maximum angles for both, that are still allowed. From these ranges I would caclulate the max. allowed angle for any certain zoom level. I think it's a linear relation.

So, when you see zoom 1.0 allows up to 30 degrees and zoom 3.0 will allow up to 60 degrees, then for example zoom 2.0 would go up to 45 degrees rotation. (and minus 45, of course)

The calculation must be done with both seperately, width and height of the screen.

Last edited 2010