yazdmich

Untitled

Oct 10th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. setup and variable declarations
  3. */
  4.  
  5. View.Set ('graphics:778;778,offscreenonly')
  6.  
  7. const midx := maxx div 2
  8. const midy := maxy div 2
  9.  
  10. type cart :
  11. record
  12. m : array 0 .. 778, 0 .. 778 of int
  13. x : array 0 .. 778 of int
  14. y : array 0 .. 778 of int
  15. z : array 0 .. 778 of int
  16. end record
  17.  
  18. var x, y, z : int
  19. var map : array 0 .. 360 of cart
  20.  
  21. /*
  22. begin program
  23. */
  24.  
  25. /*
  26. begin render and capture
  27. */
  28.  
  29. for q : 0 .. 360
  30. cls
  31. /*
  32. begin render of frame
  33. */
  34. for s : 0 .. midx
  35. for t : 1 .. midy
  36. map (q).x (s) := round (cosd (t) * s) + midx %---------------------------------%
  37. map (q).y (t) := round (sind (s) * t) + midy % calculate position of plot data %
  38. map (q).z (s) := t %---------------------------------%
  39. x := map (q).x (s) - midx
  40. z := map (q).z (s)
  41. x := round (cosd (q) * x - sind (q) * z) % calculate rotation around y-axis
  42. map (q).x (s) := x + midx
  43. if q > 0 then
  44. Draw.Dot(map(q).x(s), map(q).y(t), (s mod t) mod maxcolour)
  45. else
  46. Draw.Dot(map(q).x(s), map(q).y(t), black)
  47. end if
  48. end for
  49. end for
  50. /*
  51. end render of frame
  52. */
  53.  
  54. /*
  55. begin capture of frame
  56. */
  57. for i : 0 .. maxx
  58. for o : 0 .. maxy
  59. map(q).m(i,o) := whatdotcolour(i,o)
  60. end for
  61. end for
  62. /*
  63. end capture of frame
  64. */
  65.  
  66. View.Set ('title:Rendering: ' + realstr (round ((q / 360) * 1000) / 10, 3) + '% complete') % update title bar to show rendering status
  67. View.Update
  68. end for
  69.  
  70. /*
  71. end render and capture
  72. */
  73.  
  74. cls
  75. View.Update
  76. Input.Pause
  77.  
  78. /*
  79. begin playback
  80. */
  81.  
  82. loop
  83. for q : 0 .. 360
  84. cls
  85. for s : 0 .. maxx
  86. for t : 0 .. maxy
  87. Draw.Dot (s, t, map(q).m(s,t))
  88. end for
  89. end for
  90. View.Update
  91. end for
  92. cls
  93. Input.Pause
  94. end loop
Add Comment
Please, Sign In to add comment