mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Added a few example scenes
This commit is contained in:
parent
585429e8ee
commit
fd86816b66
3 changed files with 19 additions and 14 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,2 +1,7 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
animation_files/
|
animation_files/
|
||||||
|
.DS_Store
|
||||||
|
homeless.py
|
||||||
|
ka_playgrounds/
|
||||||
|
playground.py
|
||||||
|
prettiness_hall_of_fame.py
|
||||||
|
|
14
README.md
14
README.md
|
@ -27,16 +27,6 @@ cd aggdraw-64bits
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
Not exactly sure. I think I'm supposed to run `python extract_scene.py
|
Try running the following:
|
||||||
generate_logo.py`, but that fails with the following error.
|
python extract_scene.py -p example_scenes.py SquareToCircle
|
||||||
|
|
||||||
```
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "extract_scene.py", line 205, in main
|
|
||||||
handle_scene(SceneClass(**scene_kwargs), **config)
|
|
||||||
File "/Users/scott/scratch/manim/scene/scene.py", line 32, in __init__
|
|
||||||
self.construct(*self.construct_args)
|
|
||||||
File "/Users/scott/scratch/manim/./generate_logo.py", line 50, in construct
|
|
||||||
self.interpolation_factor
|
|
||||||
TypeError: interpolate() takes exactly 5 arguments (4 given)
|
|
||||||
```
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ from mobject.vectorized_mobject import *
|
||||||
|
|
||||||
|
|
||||||
## To watch one of these scenes, run the following:
|
## To watch one of these scenes, run the following:
|
||||||
## python extract_scene.py -p <SceneName>
|
## python extract_scenes.py -p <SceneName>
|
||||||
|
|
||||||
class SquareToCircle(Scene):
|
class SquareToCircle(Scene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
|
@ -35,8 +35,18 @@ class SquareToCircle(Scene):
|
||||||
self.play(Transform(square, circle))
|
self.play(Transform(square, circle))
|
||||||
self.dither()
|
self.dither()
|
||||||
|
|
||||||
|
class WarpSquare(Scene):
|
||||||
|
def construct(self):
|
||||||
|
square = Square()
|
||||||
|
self.play(ApplyPointwiseFunction(
|
||||||
|
lambda (x, y, z) : complex_to_R3(np.exp(complex(x, y))),
|
||||||
|
square
|
||||||
|
))
|
||||||
|
self.dither()
|
||||||
|
|
||||||
|
|
||||||
|
class WriteStuff(Scene):
|
||||||
|
def construct(self):
|
||||||
|
self.play(Write(TextMobject("Stuff").scale(3)))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue