-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
31 lines (24 loc) · 973 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from manim import *
class DefaultTemplate(Scene):
def construct(self):
circle = Circle() # create a circle
circle.set_fill(PINK, opacity=0.5) # set color and transparency
square = Square() # create a square
square.flip(RIGHT) # flip horizontally
square.rotate(-3 * TAU / 8) # rotate a certain amount
triangle = Triangle()
triangle.flip(LEFT)
triangle.rotate(-3 * TAU / 8)
self.play(Create(square)) # animate the creation of the square
self.play(Transform(square, circle)) # interpolate the square into the circle
self.play(FadeOut(square))
self.play(Create(circle))
self.play(Transform(circle, triangle))
self.play(FadeOut(circle))
self.play(Create(triangle))
self.play(FadeOut(triangle))
t = Text("Manim Works!")
t.scale(2)
self.play(Write(t))
self.play(FadeOut(t))
self.wait()