Streching rectangle #3367
Answered
by
uwezi
Basavaraj-PN
asked this question in
Q&A
Streching rectangle
#3367
-
rectangle is not properly stretching, can anyone explain? def lerp(a, b, t) -> float:
return a + (b - a) * t
class StretchRectangle(Scene):
def construct(self):
rectangle = Rectangle()
self.add(rectangle) # Add the rectangle to the scene
t = ValueTracker(0)
def lerp_updater(rec):
t_ = t.get_value()
v = lerp(-2, 2, t_)
rec.stretch_about_point(v, 0, rec.get_left())
rectangle.add_updater(lerp_updater)
self.play(
t.animate.set_value(1),
run_time=8,
rate_func=smooth,
)
self.wait(1) # Wait for 1 second at the end |
Beta Was this translation helpful? Give feedback.
Answered by
uwezi
Sep 12, 2023
Replies: 1 comment
-
I assume that this is the same question you asked on Discord? |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Basavaraj-PN
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I assume that this is the same question you asked on Discord?
https://discord.com/channels/581738731934056449/1151188983783641159/1151188985545232444