ManimCommunity / ManimCommunity/manim

ImageMobject in ThreeDScene Camera Move Issue

Open
#3,146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

Description of bug / unexpected behavior

When I do a move animation on the the frame_center in a ThreeDScene, an ImageMobject is shifted a different amount from the rest of the mobjects in the scene.

https://user-images.githubusercontent.com/14181830/216439359-d5291c9a-c364-4735-b6f9-4670cfab57af.mp4

Expected behavior

Both the Square and the ImageMobject should move the same amount.

How to reproduce the issue

from manim import *

from PIL import Image
import numpy as np

class NeuralNetworkScene(ThreeDScene):
    """Test Scene for the Neural Network"""

    def construct(self):
        # Make the Layer object
        image = Image.open("../assets/mnist/digit.jpeg")
        numpy_image = np.asarray(image)

        square = Square().shift([0.0, 2.5, 0.0])
        self.add(square)

        image_mobject = ImageMobject(
            numpy_image, 
            image_mode="RGB"
        ).scale(10)

        self.add(image_mobject)
        self.play(
            self.camera._frame_center.animate.shift(
                np.array([3.0, 0.0, 0])
            )
        )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided NeuralNetworkScene snippet, focusing on ThreeDScene, ImageMobject, and camera._frame_center.animate.shift. Compare the ImageMobject and Square positions during the camera move; done means both objects shift by the same amount.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.