Advertisement
Matthen

digital photo of a rotating chess board

Jul 12th, 2013
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Clear[trueImg];
  2. rot[t_] := 8 Pi (0.5 + 0.5 Tanh[6 (t - 0.5)]);
  3. trueImg[t_][x_, y_] := Module[{xt, yt, f},
  4. {xt, yt} = RotationMatrix[rot[t]].{x, y};
  5. yt = -yt;
  6. f = 0.5 + 0.5 Tanh[8 Sin[5 xt] Cos[5 yt]];
  7. (*List@@(ColorData["RedBlueTones"][f])*);
  8. {f, f, f}
  9. ]
  10. \[Alpha] = 0.01;
  11. res = 100;
  12. photograph[img_, t_] := Module[{dims, \[Tau]},
  13. Rasterize[Image[Table[
  14. img[t + \[Alpha] (x + 2 y )][x, y]
  15. , {y, -1, 1, 2/res}, {x, -1, 1, 2/res}]], ImageSize -> 300]
  16. ];
  17. Manipulate[
  18. photograph[trueImg, t],
  19. {{t, 0}, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement