Advertisement
Matthen

Wild Escher Animation

Sep 5th, 2015
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. c1 = Darker@ColorData["DarkRainbow"][0.1];
  2. c2 = Lighter@ColorData["Rainbow"][0.8];
  3. c3 = ColorData["DarkRainbow"][1];
  4. c4 = Black;
  5. frame[t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_] := (Graphics[
  6. Translate[
  7. Scale[Rotate[
  8. {EdgeForm[Lighter@c4], FaceForm[c1],
  9. Table[
  10. {
  11. If[t3 > 0,
  12.  
  13. Table[FaceForm[
  14. Blend[{c1, col}, t3 - 2 t8]], {col, {c1, c2, c3}}][[
  15. Mod[Mod[(x - 1)/2, 2, 1] + 2 y, 3, 1]]]
  16. , {}],
  17. {
  18. Polygon[
  19.  
  20. Table[{x + (1 - t2) Mod[y, 2] - (x - 1) t3 /4 -
  21. t7 (x - 1)/4,
  22. y - If[Mod[(x + 1)/2, 2] == 0, t3/2, 0] +
  23. t7 (x - 1)/4} + p,
  24. {p, {
  25. {0, 0},
  26. {1 - t6, 0},
  27. {1 + t1/2 - t6, 0.5},
  28. {1 - t6, 1},
  29. {0, 1},
  30. {-t1/2, 0.5}
  31. }}]]
  32. }
  33. }
  34. , {x, -1, 11, 2}, {y, -1, 7}]
  35. , If[t4 > 0 && t7 == 0,
  36. {Opacity[t4],
  37. Table[
  38. {c4, FaceForm[],
  39. Line[Table[{x - (x - 1.5)/4,
  40. y - If[Mod[(x - 1.5)/2, 2] == 0, 1/2, 0]} + p
  41. , {p, {{-0.5, 0.5}, {0, 0}, {-0.5, -0.5}, {-1,
  42. 0}, {-0.5, 0.5}}}]],
  43.  
  44. Line[Table[{x - (x - 1.5)/4,
  45. y - If[Mod[(x - 1.5)/2, 2] == 0, 1/2, 0]} + p
  46. , {p, {{0, 0}, {1 - t6, 0}}}]]
  47. },
  48. {x, 1.5, 9, 2}, {y, 1, 7, 1}]}
  49. , {}]
  50. }, Pi t5/4, {4, 3}],
  51. 1 + t9 (Sqrt[2] - 1), {4, 3}
  52. ],
  53. {0, t9}
  54. ]
  55. , PlotRange -> {{1, 6.5}, {1, 5}}, Background -> White]);
  56. Manipulate[frame[t1, t2, t3, t4, t5, t6, t7, t8, t9],
  57. {{t1, 1}, 0, 1},
  58. {{t2, 1}, 0, 1},
  59. {{t3, 1}, 0, 1},
  60. {{t4, 1}, 0, 1},
  61. {{t5, 1}, 0, 1},
  62. {{t6, 1}, 0, 1},
  63. {{t7, 1}, 0, 1},
  64. {{t8, 1}, 0, 1},
  65. {t9, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement