Skip to content

Commit

Permalink
Added a few example scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed May 26, 2016
1 parent 585429e commit fd86816
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
*.pyc
animation_files/
.DS_Store
homeless.py
ka_playgrounds/
playground.py
prettiness_hall_of_fame.py
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ cd aggdraw-64bits
```

## How to Use
Not exactly sure. I think I'm supposed to run `python extract_scene.py
generate_logo.py`, but that fails with the following error.
Try running the following:
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)
```
14 changes: 12 additions & 2 deletions example_scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


## To watch one of these scenes, run the following:
## python extract_scene.py -p <SceneName>
## python extract_scenes.py -p <SceneName>

class SquareToCircle(Scene):
def construct(self):
Expand All @@ -35,8 +35,18 @@ def construct(self):
self.play(Transform(square, circle))
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)))


0 comments on commit fd86816

Please sign in to comment.