Apply matrices to Image Mobject

33 Views Asked by At

I'm trying to apply transformations to ImageMobjects but it doesn't seem to work, from asking on Discord, I was told this is because it's a Mobject and not a VMobject, is there a way that I can do it though? (even if the best way is just to create my own VMobject), this is the code that I have :

        img = manim.ImageMobject("random_image.jpeg")
        rect = manim.Rectangle(height=img.height, width=img.width)
        img.move_to(rect)
        img_with_frame = manim.Group(img, rect)
        self.add(img_with_frame)
        self.play(img_with_frame.animate.apply_matrix([[3/4, 0.5, 0], [1/3, 1, 0], [0, 0, 1]])) # random matrix
        self.wait()

this is what happens when I apply the matrix: result of running code above

0

There are 0 best solutions below