반응형
class ShiftTest(Scene):
def construct(self):
self.move_around_with_one_object()
def move_around_with_one_object(self):
dot = Dot()
directions = [RIGHT, UP, LEFT, LEFT, DOWN, DOWN, RIGHT, RIGHT]
self.add(dot)
for d in directions:
self.play(dot.shift, d)
self.wait()
self.remove(dot)
class ShiftTest(Scene):
def construct(self):
self.make_latttice()
def make_latttice(self):
dot = Dot()
directions = [RIGHT, UP, LEFT, LEFT, DOWN, DOWN, RIGHT, RIGHT]
dots = VGroup() #to remove dots
self.add(dot)
for d in directions:
dot = dot.copy()
self.play(dot.shift, d)
dots.add(dot)
self.wait(2)
self.remove(dots)
class ShiftTest(Scene):
def construct(self):
self.make_lattice_fully()
def make_lattice_fully(self):
dot = Dot()
dot.move_to(np.array([7, 5, 0]))
self.add(dot)
for y in range(4, -5, -1):
dot = dot.copy()
self.play(dot.shift, DOWN, LEFT * 14, run_time=0.1)
for x in range(-7, 7):
dot = dot.copy()
self.play(dot.shift, RIGHT, run_time=0.05)
self.wait()
반응형
'Programming > Manim code' 카테고리의 다른 글
[007]mob.get_left/mob.get_right (0) | 2020.05.05 |
---|---|
[006]Example: Coordinate Methods (0) | 2020.05.05 |
[004]mob.next_to (0) | 2020.05.05 |
[003]mob.to_corner (0) | 2020.05.05 |
[002]mob.to_edge (0) | 2020.05.05 |