Exemplo n.º 1
0
    def pushTransform(self, elm):

        c = elm.get()[1:]
        if isinstance(elm, translate):
            mat = transform.makeTransMatrix(c)

        elif isinstance(elm, scale):
            mat = transform.makeScaleMatrix(c)

        elif isinstance(elm, rotate):
            mat = transform.makeRotateMatrix(c[0], [0, 0])

        elif isinstance(elm, flip):
            mat = transform.makeFlipMatrix(c)

        else:
            mat = transform.makeIdentityMatrix()

        # should this be flipped?
        self.trans.append(transform.multMatrix(mat, self.trans[-1]))
Exemplo n.º 2
0
 def __init__(self):
     self.trans = [transform.makeIdentityMatrix()]