Frustrum Stringing and Rotation calculations Questions

Hey guys sorry for asking so many questions however I have a small question i’m not sure of, and i’m not sure if this is incredibly easy or a lot more complicated then I’ve originally thought.

So i’m in the process of trying out a triple camera setup, however i need to string them together. Worse yet the Focal Lengths of the camera will change. as a result it has the potential of being tricky since i want all the frames to line up
correctly. all of the objects pivots are in the same position, the only difference is the rotation of the cameras in the rotate Y. Now i was wondering if there was possibly a mathematical formula for this or if this expansion is linear. If its linear then its easy peachy, however if its not then i’m confused on what to do next. Hopefully i can get your guys 2 cents and thanks a ton for the help! You guys are always awesome.


Focal length won’t translate linearly into FOV and hence rotation: It’s an asymptotic function. Here’s how to get the FOV for a given camera:


"""
Created on Jun 26, 2013

@author: Steve
"""
import math

import maya.cmds as cmds
import maya.api.OpenMaya as api2



# maya uses INCHES for camera backs
# but MILLIMETERS for focal lenghts. Hence the magic number 25.4

def get_vfov(camera):
    """ 
    returns the vertical fov the supplied camera, in degrees.
    """

    fl = cmds.getAttr(camera + ".focalLength")
    vfa = cmds.getAttr(camera + ".vfa") * 25.4  # in mm
    return math.degrees(2 * math.atan(vfa / (2 * fl)))


def get_hfov(camera):
    """ 
    returns the horizontal fov the supplied camera, in degrees.
    """

    fl = cmds.getAttr(camera + ".focalLength")
    vfa = cmds.getAttr(camera + ".hfa") * 25.4  # in mm
    return math.degrees(2 * math.atan(vfa / (2 * fl)))



where hfov is the horizontal field of view and vfov is the vertical

Just got back. And what can i say Theodox you have always been helpful and a life saver much appreciated! Your script worked like a charm!