(eye, target=None, up=None)
return np.dot(translation, orientation)
Return a camera matrix.
    
    Arguments:
      * eye: the position of the camera as a 3-vector.
      * target: the position of the view target of the camera, as a 3-vector.
      * up: a normalized vector pointing in the up direction, as a 3-vector.
      
    Returns:
      * S: the 4x4 camera matrix.
Return a camera matrix.
    
    Arguments:
      * eye: the position of the camera as a 3-vector.
      * target: the position of the view target of the camera, as a 3-vector.
      * up: a normalized vector pointing in the up direction, as a 3-vector.
      
    Returns:
      * S: the 4x4 camera matrix.
Return a camera matrix . Arguments : * eye : the position of the camera as a 3 - vector . * target : the position of the view target of the camera as a 3 - vector . * up : a normalized vector pointing in the up direction as a 3 - vector . Returns : * S : the 4x4 camera matrix .
def camera_matrix(eye, target=None, up=None):
    """Return a camera matrix.
    
    Arguments:
      * eye: the position of the camera as a 3-vector.
      * target: the position of the view target of the camera, as a 3-vector.
      * up: a normalized vector pointing in the up direction, as a 3-vector.
      
    Returns:
      * S: the 4x4 camera matrix.
      
    """
    if target is None:
        target = np.zeros(3)
    if up is None:
        target = np.array([0., 1., 0.])
    zaxis = normalize(target - eye)  # look at vector
    xaxis = normalize(np.cross(up, zaxis))  # right vector
    yaxis = normalize(np.cross(zaxis, xaxis))  # up vector
    
    orientation = np.array([
        [xaxis[0], yaxis[0], zaxis[0],     0],
        [xaxis[1], yaxis[1], zaxis[1],     0],
        [xaxis[2], yaxis[2], zaxis[2],     0],
        [      0,       0,       0,     1]
        ])
     
    translation = translation_matrix(*eye)
 
    return np.dot(translation, orientation)
def camera_matrix ( eye , target = None , up = None ) : if target is None : target = np . zeros ( 3 ) if up is None : target = np . array ( [ 0. , 1. , 0. ] ) zaxis = normalize ( target - eye ) # look at vector xaxis = normalize ( np . cross ( up , zaxis ) ) # right vector yaxis = normalize ( np . cross ( zaxis , xaxis ) ) # up vector orientation = np . array ( [ [ xaxis [ 0 ] , yaxis [ 0 ] , zaxis [ 0 ] , 0 ] , [ xaxis [ 1 ] , yaxis [ 1 ] , zaxis [ 1 ] , 0 ] , [ xaxis [ 2 ] , yaxis [ 2 ] , zaxis [ 2 ] , 0 ] , [ 0 , 0 , 0 , 1 ] ] ) translation = translation_matrix ( * eye ) return np . dot ( translation , orientation )