manim
manim copied to clipboard
ImageMobject in ThreeDScene Camera Move Issue
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])
)
)
This could be related to https://github.com/ManimCommunity/manim/issues/3131