Field of View calculations

Written by Robert Nederhorst on .

This is a simple node for doing camera calculations.  I guess I could make it into a python pane

Getting field of view given horizontal ap and focal length: 2 * atan(hap / (2 * focal)) * 180 / pi

Getting focal length given horizontal ap and field of view : (hap / (2 * tan(pi * fov2 / 360)))

Here is a noop with this stuff plugged in:

NoOp {
 name CameraCalculator
 selected true
 xpos -2240
 ypos 540
 addUserKnob {20 FocalFOV l "Calculate this!"}
 addUserKnob {26 divin l Inputs}
 addUserKnob {26 "" +STARTLINE}
 addUserKnob {7 focal l "Focal Length" R 0 180}
 focal 35
 addUserKnob {7 fov2 l "Field of View" R 0 360}
 fov2 90
 addUserKnob {7 hap l "Horiz Ap" R 0 36}
 hap 23.75
 addUserKnob {26 "" +STARTLINE}
 addUserKnob {26 divout l Outputs}
 addUserKnob {7 fov l "Resulting FOV"}
 fov {{"2 * atan(hap / (2 * focal)) * 180 / pi"}}
 addUserKnob {7 focal2 l "Resulting Focal Length" R 0 180}
 focal2 {{"(hap / (2 * tan(pi * fov2 / 360)))"}}
 addUserKnob {7 diag l INVISIBLE +INVISIBLE}
 diag {{sqrt(hap*hap+vap*vap-2*hap*vap*cos(90))}}
}

Comments   

 
+2 # shamar milton 2014-05-01 03:55
Im trying to determine the fov and get the x and y values from the fov to be used in massive, Im not a math wiz, its kinda hard for me to understand the calculations.
 
 
+3 # Frank Rueter 2014-05-01 03:57
try this: http://www.nukepedia.com/python/ui/fov-panel
 
 
-2 # shamar milton 2014-05-01 04:04
appreciate it
 

You have no rights to post comments

We have 2275 guests and 72 members online