(scale=None, shear=None, angles=None, translate=None,
                   perspective=None)
return M
Return transformation matrix from sequence of transformations.

    This is the inverse of the decompose_matrix function.

    Sequence of transformations:
        scale : vector of 3 scaling factors
        shear : list of shear factors for x-y, x-z, y-z axes
        angles : list of Euler angles about static x, y, z axes
        translate : translation vector along x, y, z axes
        perspective : perspective partition of matrix

    >>> scale = numpy.random.random(3) - 0.5
    >>> shear = numpy.random.random(3) - 0.5
    >>> angles = (numpy.random.random(3) - 0.5) * (2*math.pi)
    >>> trans = numpy.random.random(3) - 0.5
    >>> persp = numpy.random.random(4) - 0.5
    >>> M0 = compose_matrix(scale, shear, angles, trans, persp)
    >>> result = decompose_matrix(M0)
    >>> M1 = compose_matrix(*result)
    >>> is_same_transform(M0, M1)
    True
Return transformation matrix from sequence of transformations.
Return transformation matrix from sequence of transformations .
def compose_matrix(scale=None, shear=None, angles=None, translate=None,
                   perspective=None):
    """Return transformation matrix from sequence of transformations.

    This is the inverse of the decompose_matrix function.

    Sequence of transformations:
        scale : vector of 3 scaling factors
        shear : list of shear factors for x-y, x-z, y-z axes
        angles : list of Euler angles about static x, y, z axes
        translate : translation vector along x, y, z axes
        perspective : perspective partition of matrix

    >>> scale = numpy.random.random(3) - 0.5
    >>> shear = numpy.random.random(3) - 0.5
    >>> angles = (numpy.random.random(3) - 0.5) * (2*math.pi)
    >>> trans = numpy.random.random(3) - 0.5
    >>> persp = numpy.random.random(4) - 0.5
    >>> M0 = compose_matrix(scale, shear, angles, trans, persp)
    >>> result = decompose_matrix(M0)
    >>> M1 = compose_matrix(*result)
    >>> is_same_transform(M0, M1)
    True

    """
    M = numpy.identity(4)
    if perspective is not None:
        P = numpy.identity(4)
        P[3, :] = perspective[:4]
        M = numpy.dot(M, P)
    if translate is not None:
        T = numpy.identity(4)
        T[:3, 3] = translate[:3]
        M = numpy.dot(M, T)
    if angles is not None:
        R = euler_matrix(angles[0], angles[1], angles[2], 'sxyz')
        M = numpy.dot(M, R)
    if shear is not None:
        Z = numpy.identity(4)
        Z[1, 2] = shear[2]
        Z[0, 2] = shear[1]
        Z[0, 1] = shear[0]
        M = numpy.dot(M, Z)
    if scale is not None:
        S = numpy.identity(4)
        S[0, 0] = scale[0]
        S[1, 1] = scale[1]
        S[2, 2] = scale[2]
        M = numpy.dot(M, S)
    M /= M[3, 3]
    return M
def compose_matrix ( scale = None , shear = None , angles = None , translate = None , perspective = None ) : M = numpy . identity ( 4 ) if perspective is not None : P = numpy . identity ( 4 ) P [ 3 , : ] = perspective [ : 4 ] M = numpy . dot ( M , P ) if translate is not None : T = numpy . identity ( 4 ) T [ : 3 , 3 ] = translate [ : 3 ] M = numpy . dot ( M , T ) if angles is not None : R = euler_matrix ( angles [ 0 ] , angles [ 1 ] , angles [ 2 ] , 'sxyz' ) M = numpy . dot ( M , R ) if shear is not None : Z = numpy . identity ( 4 ) Z [ 1 , 2 ] = shear [ 2 ] Z [ 0 , 2 ] = shear [ 1 ] Z [ 0 , 1 ] = shear [ 0 ] M = numpy . dot ( M , Z ) if scale is not None : S = numpy . identity ( 4 ) S [ 0 , 0 ] = scale [ 0 ] S [ 1 , 1 ] = scale [ 1 ] S [ 2 , 2 ] = scale [ 2 ] M = numpy . dot ( M , S ) M /= M [ 3 , 3 ] return M