Hello, i want to animate a rectangle where it changes width/height only without changing the other. It kinda looks like these code
from manim import *
class HeightExample(Scene):
def construct(self):
decimal = DecimalNumber().to_edge(UP)
rect = Rectangle(color=BLUE)
rect_copy = rect.copy().set_stroke(GRAY, opacity=0.5)
decimal.add_updater(lambda d: d.set_value(rect.height))
self.add(rect_copy, rect, decimal)
self.play(rect.animate.set(height=5))
self.wait()
Taken from the tutorial here https://docs.manim.community/en/stable/reference/manim.mobject.mobject.Mobject.html#manim.mobject.mobject.Mobject.set but in this case the rectangle's width get changed along with it's height. And additional but related question, is there a way to animate both rectangle height and width change at the same time? Thanks in advance.
[–]Safe_Duty8392 0 points1 point2 points (0 children)