yazdmich

Untitled

May 1st, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. View.Set ('graphics:778;778,offscreenonly')
  2.  
  3. const midx := maxx div 2
  4. const midy := maxy div 2
  5. var time_str, title : string
  6. type cart :
  7. record
  8. m : array 0 .. 778, 0 .. 778 of int2
  9. x : array 0 .. 778 of int2
  10. y : array 0 .. 778 of int2
  11. z : array 0 .. 778 of int2
  12. end record
  13.  
  14. var x, y, z, win1, win2 : int
  15. var map : array 0 .. 720 of cart
  16.  
  17. function eta(stepnum : int) : string
  18. var eta_ms, eta_m, eta_s : int
  19. var eta_str : string
  20. eta_ms := round(Time.Elapsed / (((stepnum / 720) * 1000) / 10) * (100 - (((stepnum / 720) * 1000) / 10)))
  21. eta_m := round(eta_ms / 1000) div 60
  22. eta_s := round(eta_ms / 1000) mod 60
  23. eta_str := intstr(eta_m)+':'+intstr(eta_s)
  24. result eta_str
  25. end eta
  26.  
  27. win1 := Window.Open ("position:top;right,graphics:778;778,offscreenonly")
  28. win2 := Window.Open ("position:top;left,graphics:300;300")
  29. for q : 1 .. 720
  30. Window.SetActive(win1)
  31. cls
  32. for s : 0 .. midx
  33. for t : 1 .. midy
  34. map (q).x (t) := round (cosd (s) * t) + midx
  35. map (q).y (s) := round (sind (t) * s) + midy
  36. map (q).z (t) := s
  37. x := map (q).x (t) - midx
  38. z := map (q).z (t)
  39. x := round (cosd (q/2) * x - sind (q/2) * z)
  40. map (q).x (t) := x + midx
  41. Draw.Dot(map(q).x(t), map(q).y(s), (s mod t) mod maxcolour)
  42. end for
  43. end for
  44. View.Update
  45.  
  46. for i : 0 .. maxx
  47. for o : 0 .. maxy
  48. /*if whatdotcolour(i,o) = 7 then
  49. map(q).m(i,o) := true
  50. else
  51. map(q).m(i,o) := false
  52.  
  53. end if*/
  54. map(q).m(i,o) := whatdotcolour(i,o)
  55. end for
  56. end for
  57. Window.SetActive(win2)
  58. cls
  59. Draw.FillArc (150, 150, 100, 100, 90, q div 2 + 90, black)
  60. locate (1, 1)
  61. /*eta_ms := round(Time.Elapsed / (((q / 720) * 1000) / 10) * (100 - (((q / 720) * 1000) / 10)))
  62. eta_m := round(eta_ms / 1000) div 60
  63. eta_s := round(eta_ms / 1000) mod 60
  64. time_str := intstr(eta_m)+':'+intstr(eta_s)*/
  65. time_str := eta(q)
  66. put round ((q / 720) * 1000) / 10, '%', ' ', time_str
  67. title := (realstr (round ((q / 720) * 1000) / 10, 3) + '% complete, ' + time_str + ' remaining')
  68. View.Set ('title:Rendering: ' + realstr (round ((q / 720) * 1000) / 10, 3) + '%')
  69. View.Update
  70. end for
  71. Window.Close(win2)
  72.  
  73. cls
  74. View.Update
  75. Input.Pause
  76.  
  77. loop
  78. for q : 1 .. 720
  79. cls
  80. for s : 0 .. maxx
  81. for t : 0 .. maxy
  82. /*if map(q).m(s,t) then
  83. Draw.Dot (s, t, black)
  84.  
  85. end if*/
  86. Draw.Dot (s, t, map(q).m(s,t))
  87. end for
  88. end for
  89. View.Update
  90. end for
  91. cls
  92. Input.Pause
  93. end loop
Advertisement
Add Comment
Please, Sign In to add comment