2 - Animate your 2D Fractal


Projects:

<<<

1

2

3

4

5

6

7

8

9

>>>


  • Goal: To think of a creative way to animate your fractal and one of the old fractals.
  • Resources
    • You need to download graphics-lib.scm again. We've added three critical functions:
      • lin-interpP, which linearly interpolates a point
      • lin-interp, which linearly interpolates a single variable
      • grow-fractal, which does the work of animating the fractal
    • I've included three example files. All you have to do to run the example is load graphics-lib.scm and then load one of these three files:
    • If you want to do more with stk-specific graphics, you can do something like:

      (.c 'create 'line 10 20 100 200 '-tag 'cs3 '-width 50 '-fill "#ff0000" '-capstyle 'round)

    • To create movies like those shown here, simply log into an instructional machine and type:
      1. unix% ~cs61a/bin/stk
      2. stk> (load "graphics-lib.scm") ;; make sure it's the new version (with stk animation support)
      3. stk> (load "ccurve-dragon-anim.scm") ;; the c-curve will now start animating. When you're ready to animate your own fractal, model it after this file (or any of the others above) and load it the same way.
      4. Then, evaluate the line labeled by "write file" at the end of ccurve-dragon-anim.scm, and it will dump the screen to gifs.
        • Then, if the animation looks great, has been approved by Dan, and you don't have Quicktime Pro installed, package up all the gif files into a single zip file and email that to Dan who will convert your frames into a movie using Quicktime.
        • Or, you can use one of the following utilities to make an animated GIF:

 

 

 

 
 Sierpinski Square Sierpinski Square Alternate Dragon Curve C-Curve


Projects:

<<<

1

2

3

4

5

6

7

8

9

>>>