Skip to content

Commit

Permalink
Improve equation animation
Browse files Browse the repository at this point in the history
  • Loading branch information
marekkirejczyk committed Jun 20, 2023
1 parent fa46436 commit 47be23a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
4 changes: 3 additions & 1 deletion zkmarek/video/slides/ec/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def animate_in(self, scene):
scene.camera.frame_height / 2 * UP, scene.camera.frame_height / 3 * DOWN
)

scene.play(ReplacementTransform(c_box3, c_box4), ReplacementTransform(self.h_line, h_line2))
scene.play(
ReplacementTransform(c_box3, c_box4),
ReplacementTransform(self.h_line, h_line2))

strike1 = StrikeLine(c_box4[0][1])
scene.play(Write(strike1))
Expand Down
27 changes: 11 additions & 16 deletions zkmarek/video/slides/equation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from manim import (DOWN, UP, YELLOW, AnimationGroup, FadeIn, FadeOut, MathTex,
MoveToTarget, ReplacementTransform, Succession, Text,
VGroup, Write)
from manim import (DOWN, UP, YELLOW, FadeIn, FadeOut, MathTex, MoveToTarget,
ReplacementTransform, Text, TransformMatchingShapes, VGroup,
Write)

from .common.slide_base import SlideBase

Expand Down Expand Up @@ -42,19 +42,14 @@ def animate_in(self, scene):
scene.play(Write(self.secp_equation1))
scene.play(MoveToTarget(self.secp_equation1))
scene.play(FadeIn(self.ab))
scene.play(AnimationGroup(
ReplacementTransform(self.secp_equation1, self.secp_equation2),
FadeOut(self.ab),
))
scene.play(ReplacementTransform(self.secp_equation2, self.secp_equation3))
scene.play(
ReplacementTransform(self.secp_equation1, self.secp_equation2),
FadeOut(self.ab))
scene.play(TransformMatchingShapes(self.secp_equation2, self.secp_equation3))



def animate_out(self, scene):
scene.play(
Succession(
FadeOut(self.weierstrass_form),
FadeOut(self.weierstrass_equation),
FadeOut(self.secp256k1_label),
FadeOut(self.secp_equation3),
)
)
scene.play(FadeOut(self.weierstrass_form), FadeOut(self.weierstrass_equation))
scene.play(FadeOut(self.secp256k1_label), FadeOut(self.secp_equation3))

0 comments on commit 47be23a

Please sign in to comment.