Skip to content

sam46/FuncMorph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FuncMorph

You can create fancy looking things and linearly interpolate between them to make animations and gifs.. like you're directing a movie (not that I know what it's like XD)
And, because this is haskell, everything is a one-liner!

Work in progress! Contributions are welcome!

Dependencies

Examples

draw $ map (squiggly 3 10) (stdn 100)

1.gif

draw $ map (squiggly 15 3) (stdn 200)

2.gif

diagram $ draw $ map (squiggly 60 2) (stdn 300)

3.gif

draw $ map (squiggly 60 10) (stdn 300)

4.gif

shot3 = map (\x -> (rad*cos(2*pi*x), rad*sin(2*pi*x))) std -- circle
shot4 = rotatePts (pi / 4) shot3 -- rotate
shot5 = lerpPts 0.35 shot4 $ rotatePts (pi / 4) $ map squarify shot3 -- squircle
shot6 = map (squiggly 15 3) std
shot7 = rotatePts (-pi / 4) $ lerpPts 1.5 shot3 $ map squarify shot3 -- diamond
play [(shot3,2), (shot4,2), (shot5,2), (shot5,2), (shot6,2), (shot7,2)]

anim.gif

Docs

Check out the accompanying notebook

Like what you see?

Pythonistas can check out a similar work in Python