Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 6;
- gradient = Graphics[
- Rotate[
- Inset[ContourPlot[y, {x, 0, 1}, {y, 0, 1}, Axes -> None,
- Frame -> None, Contours -> 100, ContourLines -> False,
- ColorFunction -> (GrayLevel[0.1 + #1/1.2] &)], {0, 0}, {0,
- 0}, {1, 1}]
- , Pi/4]
- ,
- PlotRange -> {{0.2, 0.7}, {0.2, 0.7}}];
- piece = Graphics[{Texture[gradient],
- Polygon[{{0, 0}, {1/2, -1}, {1, 0}, {1/2, 1}},
- VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}];
- bg = Rasterize[Graphics[
- Table[
- {Translate[
- Inset[piece, {0, 0}, {0, 0}, {2.1, 2.1}], {xshift +
- If[EvenQ[yshift], 0.5, 0], yshift}]},
- {xshift, n}, {yshift, n}
- ]
- , Background -> GrayLevel[0.9],
- PlotRange -> {{2, n + 1}, {1, n + 1}}]];
- frame[t_] := Graphics[{Inset[bg, {0, 0}, {0, 0}, n {1.1, 1.1}],
- Translate[
- Inset[piece, {0, 0}, {0, 0}, {2.2, 2.2}], {1.65 + 0.5 t,
- 1 + t}]}
- , PlotRange -> {{0, n - 1}, {0, n + 0.5}}];
- Manipulate[frame[t], {t, 0, n - 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement