Skip to content

3D rotating and flipping does not work as expected for ImageMobject #2412

Open
@UncraftedName

Description

@UncraftedName

Description of bug / unexpected behavior

Attempting to flip a ImageMobject across an axis does not seem to behave correctly. Flipping across the UP axis acts the same as a 180° rotation, while flipping across the RIGHT axis does nothing.

How to reproduce the issue

class Main(Scene):
    def construct(self):
        imgs = [ImageMobject("thinking.png").scale(0.1) for i in range(4)]
        self.add(Group(
            imgs[0],
            imgs[1].flip(),
            imgs[2].rotate(PI, UP),
            imgs[3].apply_matrix([[-1, 0], [0, 1]])
        ).arrange(RIGHT))

Additional media files

Images/GIFs

unknown (2)

Additional comments

The only way I have figured out to flip images across a single axis so far is to edit the pixel array like so:

img.pixel_array = np.fliplr(img.pixel_array)  # for horizontal
img.pixel_array = np.flipud(img.pixel_array)  # for vertical

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issues

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions